registerS3method(genname, class, method, envir = parent.frame()) registerS3methods(info, package, env)
genname | character string giving the generic function name. |
class | character string giving the class name. |
method | character string giving the method name or a function to be registered. If this is NA or a function, the method name is constructed from genname and class. |
envir, env | the environment where the S3 method(s) should be registered |
info | a 3-columns character matrix. Each row represents one registered S3 method. The three columns represents the generic, class and method name in turn. |
package | the package name where the S3 methods should be registered. |
## Not run: ## define dummy S3 method add1.DUMMYCLASS <- function (object, scope, ...) 123L ## register in the "stats" package registerS3method("add1","DUMMYCLASS","add1.DUMMYCLASS", envir=getNamespace("stats")) ## another way of doing the same thing registerS3methods(matrix(c("add1","DUMMYCLASS","add1.DUMMYCLASS"),nrow=1), package="stats", env=getNamespace("stats")) ## End(Not run)