An alternative interface for, similar to the deprecated function in purrr. This function tries hard to not evaluate the passed arguments too eagerly which is important when working with large R objects.

It is recommended to pass all arguments named in order not to rely on on positional argument matching.

invoke(.f, ..., .args = list(), .opts = list(), .seed = NA_integer_)



Function to call.


Additional function arguments passed to .f.


Additional function arguments passed to .f, as (named) list(). These arguments will be concatenated to the arguments provided via ....


(named list())
List of options which are set before the .f is called. Options are reset to their previous state afterwards.


Random seed to set before invoking the function call. Gets reset to the previous seed on exit.


invoke(mean, .args = list(x = 1:10))
#> [1] 5.5
invoke(mean, na.rm = TRUE, .args = list(1:10))
#> [1] 5.5