tidy-evaluation
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 |
More from jsperger/llm-r-skills
ggplot2
Use when working with R ggplot2 package, especially ggplot2 4.0+ features. Covers S7 migration (@ property access), theme defaults with ink/paper/accent, element_geom(), from_theme(), theme shortcuts (theme_sub_*), palette themes, labels with dictionary/attributes, discrete scale improvements (palette, continuous.limits, minor_breaks, sec.axis), position aesthetics (nudge_x/nudge_y, order), facet_wrap dir/space/layout, boxplot/violin/label styling, stat_manual(), stat_connect(), coord reversal.
41rlang-conditions
>
13targets-pipelines
>
12hardhat
>
11tidymodels-overview
This skill should be used when working with R tidymodels packages, including when the user asks to "create a tidymodels workflow", "build a recipe", "tune a model", "use parsnip", "set up resampling", "create a workflow_set", "compare models", "stack models", or mentions tidymodels packages like recipes, parsnip, workflows, workflowsets, tune, rsample, yardstick, or stacks. Provides ecosystem context before package-specific skills.
11metaprogramming
>
10