r-style-guide

Standardize R code with snake_case naming, tidyverse-style piping, and cli::cli_abort error handling.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/impact-initiatives/ana_app --skill r-style-guide-impact-initiatives
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-style-guide
Source: https://github.com/impact-initiatives/ana_app/tree/main/.claude/.claude/skills/r-style-guide
Command: npx skills add https://github.com/impact-initiatives/ana_app --skill r-style-guide-impact-initiatives

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents inconsistent, hard-to-maintain R code by standardizing naming, formatting, function structure, and error handling so your team can review and extend work more easily.

Core Features & Use Cases

  • R code style and naming conventions: Enforces snake_case identifiers, clear noun/verb naming, and spacing/indentation rules for readability.
  • Function writing best practices: Promotes single-responsibility functions, consistent return types, and predictable outputs for easier debugging.
  • Robustness and developer ergonomics: Recommends structured, user-facing error handling using cli::cli_abort and encourages practical defaults for safer function signatures.
  • Use Case: When building an R data-processing pipeline (e.g., validating input data, transforming metrics, and producing tidy outputs), use this guide to ensure each step is well-structured and maintainable.

Quick Start

Apply the r-style-guide when writing or refactoring your R functions by using snake_case naming, 2-space indentation, and single-responsibility function design.

Frequently Asked Questions about r-style-guide

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

FAQPage Schema
How do I standardize R code style for better maintainability?

Enforce R function design best practices by structuring functions with a single responsibility, consistent return types, and predictable outputs. This approach simplifies debugging and ensures your data analysis workflows remain maintainable.

How do I handle user-facing errors in R functions?

Format R code for readability by applying snake_case identifiers, clear noun and verb naming, and strict spacing and indentation conventions. These rules ensure your codebase remains consistent and accessible for team collaboration.

What is the best way to structure R functions for data pipelines?

Build maintainable R data pipelines by standardizing function structure, enforcing tidyverse-style piping, and applying consistent naming conventions. This ensures each transformation step is well-structured and produces predictable, tidy outputs.

Does this R style guide support tidyverse-style piping?

Yes, this R style guide applies to data transformation workflows that require consistent tidyverse-style piping. It standardizes function design and formatting to ensure your piped operations remain readable and maintainable.