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

2025-01-08 Thread Bert Gunter
That's very nice, Hadley. Simple and clean. Never would have thought of it myself. As usual, however, in the course of my churnings, I have a further complication to add. But first ... **TO ALL**: Feel free to ignore the following, as I'm just fooling around here and don't want to waste your time

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

2025-01-08 Thread Hadley Wickham
I'd propose an alternative that I think is superior: rely on the semantics of ... to do the work for you: f1 <- function(...){ one <- list(...)[['a']] two <- ...elt(match('a', ...names())) c(one, two, three(...)) } three <- function(a, ...) { a } f1(a = 1, b = 2, c = 3) #> [1] 1 1 1 On

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

2025-01-08 Thread Martin Maechler
> Sorkin, John > on Tue, 7 Jan 2025 22:03:02 + writes: > Colleagues, > My interest is not in writing ad hoc functions (which I might use once to analyze my data), but rather what I will call a system function that might be part of a package. The lm function is a paradigm