Thursday, March 1, 2012

"..." arguments in R

"..." arguments is a way to pass unknown parameters to downstream functions.

This is a typical usage.

> a <- function(...){
return(b(...))
}

b <- function(...){
return(c(...))
}

c <- function(varIn){
return(varIn)
}
> a(varIn="hello")
[1] "hello"

No comments:

Post a Comment