[R] setMethod and contains not saving

From: Joseph Wang <joe_at_confucius.gnacademy.org>
Date: Fri 24 Feb 2006 - 13:36:28 EST


Sorry if this is a duplicate....

I'm having the following problem saving methods which are subclasses of other objects. Is there a workaround. The problem is that the R file that triggers this bug is several meg, and I'd like to load from a RData file.

This works

> setClass('foo')

[1] "foo"

> setMethod('$', 'foo', function(x,name) x)

[1] "$"

> showMethods('$')

Function "$":
x = "ANY"
x = "foo"

> q()

Save workspace image? [y/n/c]: y
(restart)

> showMethods('$')

Function "$":
x = "ANY"
x = "foo"

This doesn't ....

> setClass('bar', contains='foo')

[1] "bar"

> setMethod('$', 'bar', function(x,name)x)

[1] "$"

> showMethods('$')

Function "$":

x = "ANY"
x = "foo"
x = "bar"

> q()

Save workspace image? [y/n/c]: y
(restart)

> showMethods('$')

Function "$":
x = "ANY"



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Feb 24 13:45:32 2006

This archive was generated by hypermail 2.1.8 : Fri 24 Feb 2006 - 15:08:47 EST