Dear List,

 

So far, I really like those new R5 classes. But what kind of puzzles me is
that it's not just enough to define the actual reference class, I also have
to assign it to an object (e.g. 'MyRefObj') in order to fire
'MyRefObj$new(.)'.

 

S4:

setClass("Blabla", .)

x <- new("Blabla")

 

R5:

MyRefObj <- setRefClass("Blabla", .)

x <- MyRefObj$new(.)

 

But then how do I define a reference class in a package that should be
available after the package is loaded via 'library(my_pkg)' as there is no
'MyRefObj' at startup yet? Do I have to call the script where the definition
lives?

 

Thanks for any comments,

Janko

 


        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to