Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)

I was reading some book and I came across the  below function:

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

}

What is "..." ?

Is there any reference on this?

1 Answer

0 votes
by (108k points)

"..." 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"

If you want more information on R programming then you can just write: ?"..." on the console of RStudio.

Related questions

Browse Categories

...