fn_fmls

0th

Percentile

Extract arguments from a function

fn_defaults() returns a named list of default arguments. fn_fmls_names() returns the names of the arguments.

Usage
fn_fmls(fn = NULL)
fn_fmls_names(fn = NULL)
Arguments
fn
A function. It is lookep up in the calling frame if not supplied.
Details

Contrarily to formals(), these helpers also work with primitive functions. See is_function() for a discussion of primitive and closure functions.

See Also

call_args() and call_args_names()

Aliases
  • fn_fmls
  • fn_fmls_names
Examples
# Extract from current call:
fn <- function(a = 1, b = 2) fn_fmls()
fn()

# Works with primitive functions:
fn_fmls(base::switch)
Documentation reproduced from package rlang, version 0.0.0.9000, License: GPL-3

Community examples

Looks like there are no examples yet.