Skip to content
Back to formatted view

Raw Message

Message-ID: <200602232036.29085.joe@confucius.gnacademy.org>
Date: 2006-02-24T02:36:28Z
From: Joseph Wang
Subject: setMethod and contains not saving

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"