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

pairlist2

Create pairlists with splicing support


Description

This pairlist constructor uses dynamic dots. Use it to manually create argument lists for calls or parameter lists for functions.

Usage

pairlist2(...)

Arguments

...

<dynamic> Arguments stored in the pairlist. Empty arguments are preserved.

Examples

# Unlike `exprs()`, `pairlist2()` evaluates its arguments.
new_function(pairlist2(x = 1, y = 3 * 6), quote(x * y))
new_function(exprs(x = 1, y = 3 * 6), quote(x * y))

# It preserves missing arguments, which is useful for creating
# parameters without defaults:
new_function(pairlist2(x = , y = 3 * 6), quote(x * y))

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.