Skip to content
Prev 336727 / 398513 Next

Checking for and adding "..." arguments to a function...

On Feb 17, 2014, at 1:22 PM, Jonathan Greenberg wrote:

            
One way:
+ {
+ return(a+b+c)
+ }
$a


$b


$c


$...
[1] 1
+ {
+ return(a+b+c)
+ }
[1] 0
Not exactly sure but the usual way to capture the objects passed in the three dots mechanism is with list(...)
+ { others <- list(...); for(i in others) {cat(i);cat("\n")}
+ return(a+b+c)
+ }
4
5
[1] 6
David Winsemius
Alameda, CA, USA