1

I sometimes meet the following code

foo <- function(x,y,...){

}

What is "..." ?

Is there any reference?

Camford Oxbridge
  • 784
  • 7
  • 19

1 Answers1

0

... is used to pass optional additional arguments to a function. Here is one example :

foo <- function(x, y, ...) paste(x, y, ...)

foo('a', 'bcd')
#[1] "a bcd"

foo('a', 'bcd', 'aaa')
#[1] "a bcd aaa"

foo('a', 'bcd', 'aaa', 'def')
#[1] "a bcd aaa def"

The documentation of this is present at ?"...".

Ronak Shah
  • 355,584
  • 18
  • 123
  • 178