What problem does it solve?
Writing consistent R code across projects can be challenging; this guide provides a formal standard for naming, spacing, layout, and function design to improve readability and maintainability.
Core Features & Use Cases
- Enforces snake_case naming for variables and functions to promote readability and consistency across projects.
- Recommends 2-space indentation, explicit line breaks, and tidy layout for easier review and collaboration.
- Prescribes conventional assignment with <- and discourages ambiguous patterns to reduce errors.
- Provides patterns for function design (single-responsibility functions, clear return values) to enhance reliability and testability.
- Use Case: Teams working on R scripts or packages can apply these standards to ensure uniform style, simplify code reviews, and accelerate onboarding.
Quick Start
To start using the r-style-guide, adopt snake_case naming, prefer <- for assignment, maintain 2-space indentation, and structure code as outlined in the guide. Then apply the examples and standards when writing new scripts.