Displaying 1 result from an estimated 1 matches for "objfactory".
2008 Feb 25
1
how to write dput-able objects
...= {R News},
year = 2001,
volume = 1,
number = 3,
pages = {17--19},
month = {September},
url = http,
pdf = Rnews2001-3
}
One deficiency of this approach is that dput() does not export all data pertained to the object. For example
> objfactory <- function(nm) {
+ list(name = function() nm)
+ }
>
>
> obj <- objfactory('foo')
>
> obj$name()
[1] "foo"
> dput(obj)
structure(list(name = function ()
nm), .Names = "name")
As one can see the data piece of the obj, nm='foo', is not exp...