Core R programming skill for all R code, package development, and data science workflows. Use when writing R functions, building packages, using tidyverse (dplyr, ggplot2, purrr), creating Shiny apps, working with R Markdown/Quarto, or doing data analysis—e.g., "write an R function", "refactor this R code", "create a Shiny dashboard", "set up package tests", "debug R errors".
89
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
YOU MUST apply this skill for ALL R code, package development, and data science workflows. This skill provides production-grade R guidance and enforces modern best practices. No exceptions.
IMMEDIATELY use Context7 for package-specific APIs—outdated documentation causes bugs. Every time.
When loading any complementary skill, YOU MUST announce: "Loading [skill-name] with r-expert"
Load these additional skills IN COMBINATION with r-expert when applicable:
NEVER skip complementary skills when the task requires them. Skipping specialized guidance = substandard results. Every time.
FOLLOW THIS SEQUENCE. No deviations.
Package documentation without Context7 verification = stale information. Every time.
YOU MUST use Context7 for ALL package-specific documentation. Hard-coded knowledge becomes outdated. No exceptions.
Standard library IDs:
# Tidyverse core
/tidyverse/dplyr # Data manipulation
/tidyverse/ggplot2 # Visualization
/tidyverse/tidyr # Data reshaping
/tidyverse/purrr # Functional programming
/tidyverse/readr # Data import
# Development
/r-lib/devtools # Package development
/r-lib/usethis # Project setup
/r-lib/testthat # Testing
# ALWAYS check references/r-context7-mappings.md for the complete listR code written without Context7 lookup = latent bugs. Every production R workflow uses Context7 verification.
YOU MUST follow these standards. No exceptions.
package::function() for clarity—implicit imports cause namespace conflictsCode deviating from these standards = rework required. Every time.
data <- raw_data |>
dplyr::filter(year >= 2020) |>
dplyr::mutate(
total = price * quantity,
category = forcats::fct_lump(category, n = 5)
) |>
dplyr::group_by(region) |>
dplyr::summarise(
revenue = sum(total, na.rm = TRUE),
.groups = "drop"
)# Use withr for temporary state
withr::with_tempfile("tmp", {
readr::write_csv(data, tmp)
processed <- readr::read_csv(tmp, show_col_types = FALSE)
})
```text
### Package Structure
```text
my-package/
├── DESCRIPTION # Package metadata
├── NAMESPACE # Auto-generated exports
├── R/ # Source code
│ ├── utils.R # Internal helpers
│ └── main-feature.R # Main functionality
├── tests/
│ └── testthat/ # Tests
├── man/ # Documentation (auto)
└── README.Rmd # Package READMEContext7 queries without the mappings reference = incorrect library IDs. Always check the reference first.
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.