r-data-science
SKILL.md
R Data Science
Overview
Generate high-quality R code following tidyverse conventions and modern best practices. This skill covers data manipulation, visualization, statistical analysis, and reproducible research workflows commonly used in public health, epidemiology, and data science.
Core Principles
- Tidyverse-first: Use tidyverse packages (dplyr, tidyr, ggplot2, purrr, readr) as the default approach
- Pipe-forward: Use the native pipe
|>for chains (R 4.1+); fall back to%>%for older versions - Reproducibility: Structure all work for reproducibility using Quarto, renv, and clear documentation
- Defensive coding: Validate inputs, handle missing data explicitly, and fail informatively
Quick Reference: Common Patterns
Data Import
library(tidyverse)