I want to pass arguments to a function that aren't to be evaluated until they're used within the function. As a trivial example, how would I go about if I wanted to pass ... = foo, 'bar'
to the following function, while foo
is defined within the function:
myfunc <- function(X, ...) {
for (foo in seq_along(X)) {
cat(..., '\n')
}
}
myfunc(X = 1:5, foo, 'bar')
I tried using cat(substitute(...), '\n')
, which seems to merely omit foo
.
Thanks!