5

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

Nick
  • 51
  • 2
  • Please add the non-base packages you use. –  Oct 06 '15 at 05:32
  • Thanks for fixing the format. I've added the installed packages as they appear in the Packages tab in RStudio, but they all look like base ones to me. – Nick Oct 06 '15 at 05:48
  • Yes, you are right, they are. Strangely, I got an error first. However, now, I got neither error not warning while running your sample code. –  Oct 06 '15 at 05:50
  • Yes, I think I saw an error flash past the first time I used setRefClass, but I assumed, being new to R, that it was my fault. Not sure now. – Nick Oct 06 '15 at 06:24
  • 2
    So, what did you do to fix this? I have the same issue. –  Oct 21 '15 at 07:28
  • @rafstraumur I found that it was just RStudio entering a bad state. If I terminated R (not just a restart), the error went away; but I still don't really understand why it occurred to begin with. – russellpierce Nov 06 '15 at 11:43
  • Well, than it is obviously a bug and should be reported. This is an annoying waste of time. I wish the R community was bigger, –  Nov 10 '15 at 07:58
  • Encountered exactly the same problem today. Wasted lots of time in debugging. I thought it was my fault. – wdg Mar 02 '16 at 07:11
  • This doesn't seem to be a problem anymore. – csgillespie Sep 03 '16 at 20:16
  • I'm voting to close this question as off-topic because this bug seems to be fixed. – csgillespie Sep 03 '16 at 20:16

0 Answers0