Back
I was reading some book and I came across the below function:
foo <- function(x,y,...){}
foo <- function(x,y,...){
}
What is "..." ?
Is there any reference on this?
"..." means to have an additional set of parameters inside any function. Refer to the below code:
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"
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"
If you want more information on R programming then you can just write: ?"..." on the console of RStudio.
30.9k questions
32.9k answers
500 comments
665 users