Janko Thyson
2011-Aug-24 09:35 UTC
[Rd] Bug in 'setRefClass()' regarding how args in '...' are passed to 'setClass()'?
Dear list, in ?setRefClass it says that '...' can be used to supply other arguments that are passed to 'setClass()'. Yet, I think that's not true for argument 'prototype', but maybe I overlooked something: setClass("Plugin") setClass(Class="PluginDefault", contains="Plugin", representation=representation(.PRIMARY="function"), prototype=prototype(.PRIMARY=function(src) src) ) PluginDefault <- function() new("PluginDefault") PluginDefault() PluginDefault()$.PRIMARY # Desired prototype content #+++++ START A NEW R SESSION BEFORE CONTINUING setRefClass("Plugin") setRefClass(Class="PluginDefault", contains="Plugin", fields=list(.PRIMARY="function"), prototype=prototype(.PRIMARY=function(src) src) ) PluginDefault <- function() new("PluginDefault") PluginDefault() PluginDefault()$.PRIMARY # No prototype content Regards, Janko