1

I sometimes meet the following code

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

}

What is "..." ?

Is there any reference?

Camford Oxbridge
  • 834
  • 8
  • 21

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
  • 377,200
  • 20
  • 156
  • 213