Last chance! 50% off unlimited learning
Sale ends in
fn_defaults()
returns a named list of default
arguments. fn_fmls_names()
returns the names of the
arguments.
fn_fmls(fn = NULL)
fn_fmls_names(fn = NULL)
formals()
, these helpers also work with
primitive functions. See is_function()
for a
discussion of primitive and closure functions.
call_args()
and
call_args_names()
# Extract from current call:
fn <- function(a = 1, b = 2) fn_fmls()
fn()
# Works with primitive functions:
fn_fmls(base::switch)
Run the code above in your browser using DataLab