Skip to content
Prev 15017 / 63424 Next

S4 packages and .Rdata file.

Witold Eryk Wolski wrote:

            
When you save a workspace image, that includes method definitions done 
in the global environment (as you would certainly want it to).  The 
objects have special names in order to follow the "metadata" semantics 
in "Programming with Data" and also not to conflict with ordinary objects.

If you _don't_ want to save methods for function "f", use 
removeMethods("f") before saving and quitting.

To find out what functions have methods defined in the global 
environment, use getGenerics(1).  Then you can use removeMethods() for 
those functions & resave the workspace image.

If the function "f" has methods in other packages as well, use
   removeMethods("f", all=FALSE)
to remove only the methods object in the global environment.

And if you like the grubby but direct approach, do
   objects(all=TRUE)
which will show methods lists as objects with names starting with 
".__M__".  You can remove those objects using the list= argument to rm().