1 Introduction
Just refer to the following docs when needed:
- Official doc for the latest R: https://cran.r-project.org/manuals.html.
2 Appendices
2.1 Tidy-evaluation verbs summary
Quoted and unquoted column names:
| Usage | Quoted or unquoted? |
|---|---|
x |
Unquoted |
`x` |
Quoted (with the same function as an unquoted name) |
"x" |
Quoted |
var_name <- "x" then var_name |
Quoted |
Note:
In
"{x}",!!x,!!sym(x), and.data[[x]],xshould be a quoted column name.In
{ x },xshould be an unquoted column name.
- Outside a function
:=: usually used inmutate,rename, etc. Allowed LHS:"{x}",!!x,!!sym(x); allowed RHS:!!sym(x),.data[[x]].Relation operators: usually used in
filter, etc. Allowed LHS/RHS:!!sym(x),.data[[x]].
- Inside a function
All rules used outside a function are also valid inside a function. In addition, { x } can be LHS/RHS of :=/relation operators inside a function.