Tidy evaluation is a framework for non-standard (delayed) evaluation in R that makes it easier to program with tidyverse functions. This cheat sheet covers the key vocabulary and the rlang functions used to quote, unquote, and evaluate code.

What’s covered#

  • Vocabulary – symbols, environments, constants, call objects, expressions, quosures, and expression vectors
  • Quoting Code – quo(), enquo(), quos(), enquos() for quosures; expr(), enexpr(), exprs(), enexprs() for expressions; ensym() for symbols
  • Parsing and Deparsing – parse_expr(), expr_text(), quo_name()
  • Building Calls – call2(), exec() for constructing and evaluating calls
  • Evaluation – eval_bare(), eval_tidy(), data masks, and the .data$ pronoun
  • Quasiquotation – !! (unquote), !!! (unquote-splice), := (unquote in LHS)
  • Programming Recipes – writing functions that recognize quasiquotation operators