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

modify_call

Modify the arguments of a call.


Description

Modify the arguments of a call.

Usage

modify_call(call, new_args)

Arguments

call

A call to modify. It is first standardised with standardise_call.

new_args

A named list of expressions (constants, names or calls) used to modify the call. Use NULL to remove arguments.

Examples

call <- quote(mean(x, na.rm = TRUE))

# Modify an existing argument
modify_call(call, list(na.rm = FALSE))
modify_call(call, list(x = quote(y)))

# Remove an argument
modify_call(call, list(na.rm = NULL))

# Add a new argument
modify_call(call, list(trim = 0.1))

# Add an explicit missing argument
modify_call(call, list(na.rm = quote(expr = )))

pryr

Tools for Computing on the Language

v0.1.4
GPL-2
Authors
Hadley Wickham [aut, cre], R Core team [ctb] (Some code extracted from base R)
Initial release

We don't support your browser anymore

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