rlang (version 0.0.0.9000)

call_args: Extract arguments from a call

Description

Extract arguments from a call

Usage

call_args(call = NULL)
call_args_lsp(call = NULL)
call_args_names(call = NULL)

Arguments

call
Can be a call, a formula quoting a call in the right-hand side, or a frame object from which to extract the call expression. If not supplied, the calling frame is used.

Value

A named list of arguments. The _lsp version returns a named pairlist.

See Also

fn_fmls() and fn_fmls_names()

Examples

Run this code
call <- quote(f(a, b))

# Subsetting a call returns the arguments in a language pairlist:
call[-1]

# Whereas call_args() returns a list:
call_args(call)

# When the call arguments are supplied without names, a vector of
# empty strings is supplied (rather than NULL):
call_args_names(call)

Run the code above in your browser using DataCamp Workspace