[Rd] configure fail for XML package on freebsd
Robert Hijmans
r.hijmans at gmail.com
Wed Mar 11 15:40:44 CET 2009
I would like to write an S4 generic for 'median', but I am not sure
how to do this properly as the function does not have a "..." argument
I can do this
setGeneric("median", function(x, na.rm=FALSE)
standardGeneric("median"))
but I want to be able to pass it a number of objects of the same
class, so I need a ... argument; or use signature='list' which is not
very useful.
I can do this:
setGeneric("median", function(x, ..., na.rm=FALSE)
standardGeneric("median"))
and
setMethod('median', signature(x='ANY'),
function(x, ..., na.rm=FALSE){ x <- c(x, ...)
return(stats::median(x, na.rm=na.rm))
# }
#)
setMethod("median", signature(x='Raster'),
function(x, ..., na.rm=FALSE){
# rasters <- list(...)
More information about the R-devel
mailing list