19.3 Quote
- Expression
# for interactive use
rlang::expr(x+y)
#> x + y
# enexpr works on function arguments (looks at internal promise object)
f2 <- function(x) rlang::enexpr(x)
f2(a + b + c)
#> a + b + c
- To capture multiple arguments, use
enexprs()
- For symbols, there is
ensym
andensyms
which check that the argument is a symbol or string.