An LLM skill for modern tidyverse R using R >= 4.5.0, tidyverse >= 2.0.0, and dplyr >= 1.2.0.
When you ask an LLM to write R code, it draws on its training data, which mixes base R, old StackOverflow posts, deprecated tidyverse APIs, and current best practice. This skill gives the model a structured reference for modern tidyverse patterns so it produces clean, idiomatic code with less back-and-forth.
The skill covers: native pipe and lambda syntax, join_by() joins, .by grouping, the dplyr 1.2 recode/replace family, tidy selection, stringr, error handling with cli, and migration from base R or older tidyverse APIs.
Clone directly into your skills directory:
git clone https://github.com/statzhero/tidy-r-skill.git ~/.claude/skills/tidy-rThat's it. The skill is available immediately as /tidy-r in any Claude Code session.
If you prefer not to use the terminal, you can add skills from the Claude desktop app:
- Download this repository as a ZIP from GitHub.
- Open the Claude desktop app and switch to the Code tab.
- Click Customize in the left sidebar, then select Skills.
- Click the + button, choose Upload a skill, and select the ZIP file.
Clone into your user skills directory (available across all projects):
git clone https://github.com/statzhero/tidy-r-skill.git ~/.agents/skills/tidy-rIf you prefer not to use the terminal, download the ZIP, unzip it, and move the folder to ~/.agents/skills/tidy-r/ or .agents/skills/tidy-r/ inside your project.
Paste the contents of SKILL.md into your system prompt or attach it as context. The reference files in references/ can be appended when you need coverage of a specific topic.
After installing, try this prompt in Claude Code:
/tidy-r Rewrite this using modern tidyverse:
penguins %>% group_by(species) %>% summarise(avg_bill = mean(bill_length_mm)) %>% ungroup()
The skill should guide the model toward .by grouping and native pipe.
This skill stands on the shoulders of giants, but I built it over many iterations and can no longer trace any single influence. I regret not keeping better records. If you recognize your ideas here, please open an issue so I can credit you properly.
| Topic | Source |
|---|---|
| Tidyverse style guide | https://style.tidyverse.org/ |
| dplyr | https://dplyr.tidyverse.org/ |
| stringr | https://stringr.tidyverse.org/ |
| tidyselect | https://tidyselect.r-lib.org/ |
| cli (error messages) | https://cli.r-lib.org/ |
| readr | https://readr.tidyverse.org/ |
- 2026-04-24 — Added
if_else()/case_when()plainNAguidance (dplyr >= 1.1.0). - 2026-04-10 — Updated license.
- 2026-04-07 — Streamlined SKILL.md; consolidated reference files; added tidyselect reference; fixed example code.
- 2026-03-31 — Initial release.
MIT • Ulrich Atz (ulrichatz)