代码和警告:
tinyclass <- setRefClass("TinyClass", methods = list(doNothing=function(){}))
tc <- tinyclass()
tc$doNothing()
NULL
Warning messages:
1: In installClassMethod(value, self, field, selfEnv, thisClass) :
method .objectPackage from class TinyClass was not processed into a class method until being installed. Possible corruption of the methods in the class.
2: In installClassMethod(value, self, field, selfEnv, thisClass) :
method .objectParent from class TinyClass was not processed into a class method until being installed. Possible corruption of the methods in the class.
Run Code Online (Sandbox Code Playgroud)
我也从帮助页面中提供的代码setRefClass以及我尝试制作的任何其他类中获得此代码.我在自己安装的运行R 3.2.2的Mac上可靠地得到它,并且在IT部门安装的几台运行R …