Skip to content
Prev 155561 / 398502 Next

building a package that contains S4 classes and methods

Marie Pierre Sylvestre wrote:
The main point is that you should not rely on R putting sensible code in 
the package source files, but rather stay in control yourself. What the 
warnings are telling you is that you cannot deparse an S4 object in a 
way that can be reparsed, so dump() doesn't work. What you get is

obj <-  <S4 object......>

and the syntax error from source() if you try using it. So what you need 
to is to delete it and put in the appropriate class/methods definitions 
from your original sources. It might help to look at an existing 
S4-using package.