[R] Fwd: Seeking guidance in package creation when it contains s4 class

Nipesh Bajaj bajaj141003 at gmail.com
Tue Mar 8 17:57:58 CET 2011


Any suggestion please how I can do this?


Dear all, I am having problem to create a package when this package is
supposed to have some newly created s4 class. Here is my workout:

> #rm(list = ls())
> setClass("aClass", sealed=T,  representation(slot1 = "vector", slot2 = "character"))
[1] "aClass"
> fn1 <- function(x, y, z) {
+ x <- x[1]
+ y <- y[1]
+ z <- as.character(z[1])
+ new("aClass", slot1 = x+y, slot2 = z)
+ }
> #fn1(1,2,3)
> package.skeleton("trial11")
Creating directories ...
Creating DESCRIPTION ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in './trial11/Read-and-delete-me'.
Warning message:
In dump(internalObjs, file = file.path(code_dir, sprintf("%s-internal.R",  :
 deparse of an S4 object will not be source()able

While running package.skeleton, I got this warning message, then when
I run R CMD INSTALL trial11, I got an error saying:

ERROR: unable to collate files for package 'trial11'

It would be really helpful if somebody can point me how different the
package creation will be if it contains s4 class?

Thanks,



More information about the R-help mailing list