se)
> Â Â > toGeneric("wsx")
> Â Â wsx <- function(x, ...) UseMethod("wsx")
> Â Â wsx.default <- function (x, base = 2)
> Â Â log(x, base = base)
> Â Â > wsx
> Â Â function (x, ...)
> Â Â UseMethod("wsx")
> Â Â > wsx.def
I'm trying to make a function to turn a regular function into an S3 generic
one. I want myMethod to be:
function(x,...) UseMethod("myMethod")
But I keep getting:
function(x,...) UseMethod(func)
Here's the function:
toGeneric<-function(func) {
env<-environment(get(func))
2 matches
Mail list logo