Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

call_args

Extract arguments from a call


Description

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 deprecated and renamed to call_args() and call_args_names(). See lifecycle section in call2() for more about this change.

See Also

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)

rlang

Functions for Base Types and Core R and 'Tidyverse' Features

v0.4.11
MIT + file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.