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

enquo0

Defuse arguments without automatic injection


Description

The 0-suffixed variants of enquo() and enquos() defuse function arguments without automatic injection (unquotation). They are useful when defusing expressions that potentially include !!, !!!, or {{ operations, for instance tidyverse code. In that case, enquo() would process these operators too early, creating a confusing experience for users. Callers can still inject objects or expressions using manual injection with inject().

Usage

enquo0(arg)

enquos0(...)

Arguments

arg

A symbol for a function argument to defuse.

...

Dots to defuse.

Details

None of the features of dynamic dots are available when defusing with enquos0(). For instance, trailing empty arguments are not automatically trimmed.

See Also

Examples

automatic_injection <- function(x) enquo(x)
no_injection <- function(x) enquo0(x)

automatic_injection(foo(!!!1:3))
no_injection(foo(!!!1:3))

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.