I have been writing some S4 classes and have a problem about how I might
pass a signature to "c()".

Take the following example:

setClass("collection", representation("list", date="POSIXt"))

x <- new("collection", list(1,2,3), date=Sys.time())
y <- new("collection", list(4,5,6), date=Sys.time())

obviously, I can do c(x,y), but this wil be of class "list"

I would like to do something like:

setMethod("c", signature("collection"),
    function(...) {
        if([EMAIL PROTECTED]@date) stop("at different dates!")
        res <- c(as(e1, "list"),as(e2, "list"))
        new("collection", res, date = [EMAIL PROTECTED])
        })

but c() takes "..." as its arguments and I don't know how I might reference
that with a signature and appropriate arguments etc.

Has anybody an ideas? I presume it doesn't matter that c() is
.Primative("c")?

Regards, 

John Marsland


********************************************************************** 
This is a commercial communication from Commerzbank AG.\ \ This ... {{dropped}}

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to