0

This works just fine:

FuncData<-setRefClass("FuncData", fields = c("Data"))
DF <- FuncData$new(Data = 4)

I rename "FuncData" to "FunData":

FunData<-setRefClass("FunData", fields = c("Data"))
DF <- FunData$new(Data = 4)

And get an error:

Error in initialize(value, ...) : 
  invalid name for slot of class “FunData”: Data

Any idea what's happening?

R 3.2.2, RStudio

UPD: after I've got a number of similarly strange errors, I've restarted RStudio and now everything works just fine. The only question left is: what was the problem which was solved by the restart?

One of the "similarly strange errors" were:

nobs(a)

resulting in:

Error in nrow(a): unused argument (a)
Oleg
  • 83
  • 6
  • I am using the Mac version and I do not get the same error. Perhaps something was corrupted. As for the second error, perhaps you didn't define `a`. – Dr G. Nov 29 '15 at 07:45
  • Well, since I got rid of those error simply by restarting RStudio it's probably RStudio's bug. For instance, I've found another similar case: http://stackoverflow.com/questions/32962354/warnings-thrown-when-accessing-methods-of-reference-class-through-rstudio – Oleg Nov 29 '15 at 08:01
  • Probably should report it nonetheless. – Dr G. Nov 29 '15 at 08:22

0 Answers0