Displaying 1 result from an estimated 1 matches for "commona".
Did you mean:
common
2010 Apr 27
1
suggestion on method dispatch
Dear all, I have define a function and its methods as follows:
######## beginning of code
fn <- function(x,...){
UseMethod("fn")
}
fn.foo1 <- function(x, commonA=1, ...){
print("fn.foo1 is called.")
}
fn.foo2 <- function(x, uniqueFoo2, common=1, ...){
## uniqueFoo2 is a unique argument in fn.foo2
x <- uniqueFoo2; class(x) <- "foo1"
## use uniqueFoo2 to generate a object of class foo1
dots <- list(...)
do.call(fn.foo1, c(list...