Displaying 2 results from an estimated 2 matches for "enexpr".
Did you mean:
e1expr
2025 Jan 09
1
Extracting specific arguments from "..."
..., a = 1, c = 3)
})
#> f1 f2 f3 f4
#> 1 1 1 1
# View the (defused) arguments after `a` has been accessed:
# returns an expression if the argument has not been evaluated, and a
number if it has
check_forced_args <- function(f) {
body(f) <- call("{", body(f), quote(rlang::enexprs(...)))
# pass `f()` some expressions to see which are evaluated
f(a = cos(0), b = sqrt(4))
}
# make a data frame showing the defused arguments for each function
lapply(ff, check_forced_args) |> do.call(rbind, args = _) |> as.data.frame()
#> a b
#> f1 1 2...
2025 Jan 08
1
Extracting specific arguments from "..."
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 with my stupid stuff.
Anyway, the complication is motivated by the use of formals() or