rhombidodecahedron
rhombidodecahedron

Reputation: 7922

Collecting all function arguments in R

Naively, I thought that R's ... notation would collect all named arguments that appear after it so that they can be passed along. For example:

> a <- function(..., arg=TRUE) b(...)
> b <- function(arg=TRUE) print(arg)
> a(arg=FALSE)
[1] TRUE # I would want this to be FALSE

Since this clearly doesn't happen, is there some way to package up all of the arguments supplied to a function so that they get sent along?

Upvotes: 0

Views: 235

Answers (1)

G. Grothendieck
G. Grothendieck

Reputation: 269431

You will need to pass arg:

a <- function(..., arg=TRUE) b(..., arg = arg)

Upvotes: 1

Related Questions