usage of ellipsis followed by empty parenthesis in R ("...()")

Viewed 29

Long time reader, first time poster.

I was trying different implementation of "substitute()" to get a list of unnamed variable from the ellipsis, when i stumbled upon the application "substitute(...())". It is cleaner than any alternative i tried so far, but i cannot find any documentation for it, or for any other application of "...()". it have the look of a function but (as far as i know) it is not one. I don't know if it safe to use, of if it is a side-effect of the internal working of "substitute"?

I would be glad for any documentation on "...()", too!

sample code:

 myfunction <- function(...){substitute(...())}
 
 variableA <- "Whatever"

 variableB <- "This a Variable"

 variableC <- "Anoter Variable"
 
 results <- myfunction(variableA,
            variableB,
            variableC)
 
 results

[[1]]
variableA

[[2]]
variableB

[[3]]
variableC

 class(results)
[1] "pairlist"

Thanks a lot for your help

0 Answers
Related