Displaying 1 result from an estimated 1 matches for "call_args".
Did you mean:
hcall_args
2024 Feb 17
2
Capturing Function Arguments
...pture the values fine, but I'm having trouble evaluating them
as if `force()` had been applied to each of them.
Here is a minimal example:
f0 <- function(x, y = 2 * z, z, a = NULL, b) NULL
f <- function(...) {
call <- rlang::call_match(fn = f0, defaults = TRUE)
args <- rlang::call_args(call)
# do something here to evaluate args as if force() had been called
# I've tried many things but haven't found a solution that handled everything
args
}
# In the below example args1 and args2 should be the same
a <- 1
args1 <- f(a, z = 1 + 100)
args2 <- list( a = 1, y...