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.