call_args

0th

Percentile

Extract arguments from a call

Extract arguments from a call

Usage
call_args(call)

call_args_names(call)

Arguments
call

Can be a call or a quosure that wraps a call.

Value

A named list of arguments.

Life cycle

In rlang 0.2.0, lang_args() and lang_args_names() were soft-deprecated and renamed to call_args() and call_args_names(). See lifecycle section in call2() for more about this change.

See Also

fn_fmls() and fn_fmls_names()

Aliases
  • call_args
  • call_args_names
Examples
# NOT RUN {
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)
# }
Documentation reproduced from package rlang, version 0.2.2, License: GPL-3

Community examples

Looks like there are no examples yet.