tidy-evaluation

Automate tidy evaluation patterns for data-masked R functions.

13|2|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/jsperger/llm-r-skills --skill tidy-evaluation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tidy-evaluation
Source: https://github.com/jsperger/llm-r-skills/tree/main/skills/tidy-evaluation
Command: npx skills add https://github.com/jsperger/llm-r-skills --skill tidy-evaluation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps R programmers use tidyverse data-masked functions (dplyr, ggplot2, tidyr) without losing reference to data columns, enabling seamless column passing through functions.

Core Features & Use Cases

  • Forward arguments with {{ }} and across() patterns to data-masked contexts.
  • Bridge data-masked functions to tidy-select workflows using across(all_of(...)) or similar patterns.
  • Use .data and .env pronouns to disambiguate variables and avoid collisions; supports dynamic column lists and iterative workflows.

Quick Start

Define a small helper to compute the mean of a masked column: my_mean <- function(data, var) { data |> dplyr::summarise(mean = mean({{ var }})) } mtcars |> my_mean(cyl)

Frequently Asked Questions about tidy-evaluation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pass data frame columns to dplyr functions inside my own R functions?▼

You pass data-masked columns in R by using the tidy evaluation pattern `{{ var }}` inside dplyr functions. This forwards the column reference from your function argument directly into the data-masked context without losing the variable reference.

What is tidy evaluation and when do I need it in R?▼

Tidy evaluation is a framework in R that allows tidyverse packages like dplyr and tidyr to interpret column names as data references. You need it when writing functions that wrap data-masked operations to ensure column arguments are forwarded correctly.

Why does my custom dplyr function lose the data column reference?▼

Your custom dplyr function loses the data column reference because it lacks tidy evaluation patterns. You must use the `{{ }}` operator to forward column arguments and apply the `.data` pronoun to disambiguate variables from data columns.

How do I bridge data-masked arguments to tidy-select workflows in R?▼

You bridge data-masked arguments to tidy-select workflows in R by combining `across()` with `all_of()`. This pattern allows data-masked column references to integrate seamlessly into tidy-select contexts within dplyr and tidyr functions.

Does this tidy evaluation approach work with older versions of R and rlang?▼

This tidy evaluation approach enforces compatibility with R versions 4.3 and above, alongside rlang 1.1.3 or higher. These requirements ensure the modern tidy evaluation patterns like `{{ }}` and `.data` pronouns function correctly.

What is the best way to avoid variable name collisions in dplyr functions?▼

The best way to avoid variable name collisions in dplyr functions is to use the `.data` and `.env` pronouns. These pronouns explicitly disambiguate between data frame columns and environment variables during tidy evaluation.