pairlist2: Collect dynamic dots in a pairlist

View source: R/call.R

pairlist2R Documentation

Collect dynamic dots in a pairlist

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 documentation built on June 22, 2024, 9:31 a.m.