Re: [R] Extracting specific arguments from "..."

2025-01-09 Thread Bert Gunter
Thanks Ian (and others), Taking the advice of ?"..." (which I should have done at the outset ... duhh!), the following seems to be the simplest solution, adequate for my needs at least: f <- function(x, ...){ lapply(seq_along(x), \(i)switch(x[i], ..., NA)) } (the usual argument checking etc.

Re: [R] Extracting specific arguments from "..."

2025-01-09 Thread Ian Farm
I might add that there seems to be a subtle difference between using `...elt()` and `match.call()`, which is that the former causes `a` itself to be evaluated while the latter doesn't: ``` # Some approaches that have been suggested: # 1. Using `list()` (Bert Gunter) f1 <- function(...) list(...)[[