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:

  1. Pair of functions - Quoting and non-quoting
    • e.g., $ (quoting) and [[ (non-quoting)
  2. Pair of Arguments - Quoting and non-quoting
    • e.g., rm(...) (quoting) and rm(list = c(...)) (non-quoting)
  3. Arg to control quoting
    • e.g., library(rlang) (quoting) and library(pkg, character.only = TRUE) (where pkg <- "rlang")
  4. Quote if evaluation fails
    • help(var) - Quote, show help for var
    • help(var) (where var <- "mean") - No quote, show help for mean
    • help(var) (where var <- 10) - Quote fails, show help for var