Possible Duplicate:
How to use R's ellipsis feature when writing your own function?
I am wondering how R interprets ... arguments?
For instance consider the makeContrasts(..., contrasts=NULL, levels)
of package limma
. You can run:
> require(limma)
> makeContrasts(a + b, b+c, levels=letters[1:3])
Contrasts
Levels a + b b + c
a 1 0
b 1 1
c 0 1
and it interprets the parameters a + b, b+c
without a, b
and c
being already defined as R objects.
I tried to make a similar function:
foo = function(...) {
print(typeof(...))
}
> foo(a + b)
Error in typeof(...) : object 'a' not found
So I am really confused what type of object is really passed to makeContrasts
? And is there anyway to modify this object?