tidy-evaluation
Installation
SKILL.md
Tidy Evaluation Programming Patterns
Data masking lets you refer to data frame columns as if they were regular objects. Programming with data-masked functions requires special patterns to pass column references through your functions.
Quick Reference
| Goal | Pattern |
|---|---|
| Forward single argument | {{ var }} |
Forward ... to data-mask |
... directly |
Forward ... to tidy-select (single arg) |
c(...) |
| Use column name from string | .data[[var]] |
| Use column names from vector | across(all_of(vars)) |
| Disambiguate env-variable | .env$x |
| Disambiguate data-variable | .data$x |
| Bridge selection to data-mask | across({{ var }}) |
| Bridge names to data-mask | across(all_of(vars)) |
| Bridge data-mask to selection | transmute() then all_of() |
| Prevent double evaluation | Assign to column first |