Skip to content
Prev 38176 / 63424 Next

Reference Classes: Generalizing Reference Class Generator objects?

Hi Daniel,

I think you want to define an "initialize" method, as in

TestClass <- setRefClass ("TestClass",
       fields = list (text = "character"),
       methods = list (
               initialize = function (text) { object <-
initFields(text=paste(text,"\n")) },
               print = function ()  { cat(text) } )
)

This seems to work as you intend:
test


All the best,
Jon
On 28 October 2010 15:13, Daniel Lee <bearlee at alum.mit.edu> wrote: