[Rd] Dispatch method on S3 or S4 class

Dario Strbenac D.Strbenac at garvan.org.au
Tue Sep 7 07:00:24 CEST 2010


Hello,

I've been attempting to make a generic method that dispatches on the first argument, which can be either an S3 or an S4 class. This is as far as I've gotten. Any suggestions about what to try next ?

library(aroma.affymetrix)
library(GenomicRanges)

setGeneric("analyse", function(x, y, ...) standardGeneric("analyse"))

setMethodS3("analyse", "AffymetrixCelSet", function(x, y, z, ...)
{
	x;
	UseMethod("analyse")
}
)

setGeneric("analyse")

setMethod("analyse", "GRangesList", function(x, y, a, b, c)
{
	x;
}
)

Thanks,
       Dario.

--------------------------------------
Dario Strbenac
Research Assistant
Cancer Epigenetics
Garvan Institute of Medical Research
Darlinghurst NSW 2010
Australia



More information about the R-devel mailing list