Warnings thrown when accessing methods of reference class through RStudio

半世苍凉 提交于 2019-12-22 06:49:13

问题


The code and the warnings:

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.

I also get this from the code supplied in the help page for setRefClass, and on any other class I try to make. I get it reliably on a Mac running R 3.2.2 which I installed myself, and intermittently on several real and virtual Windows 64 machines running R 3.2.1 which were installed by an IT department.

I am using RStudio 0.99.467. I have the following packages installed: datasets, graphics, grDevices, methods, stats, utils.

NEW INFO:

It seems that the problem occurs when I run the code through RStudio, but not through the native R gui.

Loaded packages in RStudio:

search() [1] ".GlobalEnv" "tools:rstudio" "package:stats" "package:graphics" "package:grDevices" "package:utils"
[7] "package:datasets" "package:methods" "Autoloads" "package:base"

Loaded packages in native R:

search() [1] ".GlobalEnv" "tools:RGUI" "package:stats" "package:graphics" "package:grDevices" "package:utils"
[7] "package:datasets" "package:methods" "Autoloads" "package:base"

Thoughts? Thanks

来源:https://stackoverflow.com/questions/32962354/warnings-thrown-when-accessing-methods-of-reference-class-through-rstudio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!