I want to extend a generator object, but all the R help files have on this subject is:
Note that if one wanted to extend the reference class generator capability with a subclass, this should be done by subclassing
refGeneratorSlot
, notrefObjectGenerator
.
OK, but how do you actually do this? So I've tried:
MyGenerator <- setRefClass("MyGenerator",
contains = "refGeneratorSlot",
methods = list(
new = function(...) {
message("Hello, I'm being instantiated now!")
callSuper(...)
}
)
)
but now what? How do I actually use this in conjunction with my class definitions that use setRefClass()
?