call_args: Extract arguments from a call

call_argsR Documentation

Extract arguments from a call

Description

Extract arguments from a call

Usage

call_args(call)

call_args_names(call)

Arguments

call

A defused call.

Value

A named list of arguments.

See Also

fn_fmls() and fn_fmls_names()

Examples

call <- quote(f(a, b))

# Subsetting a call returns the arguments converted to a language
# object:
call[-1]

# On the other hand, call_args() returns a regular list that is
# often easier to work with:
str(call_args(call))

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

hadley/rlang documentation built on Dec. 17, 2024, 3:26 a.m.