Skip to content
Prev 37611 / 63424 Next

S4 Method Signatures

Hello,

If the signature of a method defines which generic it implements then I'm confused about why this minimal example I invented won't work :

setGeneric("myFun", function(rs, ...){standardGeneric("myFun")})
setGeneric("myFun", function(cs, ...){standardGeneric("myFun")})

setMethod("myFun", "numeric", function(rs, colour = "Blue")
{
	cat(rs*100, colour)
})

setMethod("myFun", "character", function(cs, colour = "Red")
{
	cat(cs, colour)
})

Thanks for any tips,
                    Dario.

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