19.5 Non-quoting
Only bquote()
provides a limited form of quasiquotation.
The rest of base selectively uses or does not use quoting (rather than unquoting).
Four basic forms of quoting/non-quoting:
- Pair of functions - Quoting and non-quoting
- e.g.,
$
(quoting) and[[
(non-quoting)
- e.g.,
- Pair of Arguments - Quoting and non-quoting
- e.g.,
rm(...)
(quoting) andrm(list = c(...))
(non-quoting)
- e.g.,
- Arg to control quoting
- e.g.,
library(rlang)
(quoting) andlibrary(pkg, character.only = TRUE)
(wherepkg <- "rlang"
)
- e.g.,
- Quote if evaluation fails
help(var)
- Quote, show help for varhelp(var)
(wherevar <- "mean"
) - No quote, show help for meanhelp(var)
(wherevar <- 10
) - Quote fails, show help for var