r-style-guide

Enforce R style conventions and function design best practices.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/jhelvy/dotfiles --skill r-style-guide-jhelvy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-style-guide
Source: https://github.com/jhelvy/dotfiles/tree/main/claude/skills/r-style-guide
Command: npx skills add https://github.com/jhelvy/dotfiles --skill r-style-guide-jhelvy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps R developers adhere to best practices for code style, function design, and naming conventions, leading to more readable, maintainable, and collaborative code.

Core Features & Use Cases

  • Code Style Enforcement: Provides guidelines on spacing, indentation, line length, and comments.
  • Function Design Principles: Details best practices for function structure, naming, arguments, return values, and error handling.
  • Tidyverse Conventions: Aligns with common Tidyverse API patterns for better interoperability.
  • Use Case: When starting a new R script or refactoring existing code, consult this guide to ensure consistency and quality.

Quick Start

Apply the R style guide to format the provided R code snippet for better readability.

Frequently Asked Questions about r-style-guide

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

FAQPage Schema
What are the best practices for R coding style and function design?

Tidyverse API conventions align with common R programming patterns for better interoperability. Following these guidelines ensures code consistency, readability, and maintainability when writing R scripts or refactoring existing code.

How do I format an R script to improve readability and consistency?

Consistent R code formatting requires proper assignment operators, structured indentation, and clear comments. Following these style guide rules improves code readability and maintainability across development teams.

How should I structure error handling and return values in R functions?

R function design best practices recommend using clear return values, comprehensive error handling, and sensible default arguments. This approach enhances code maintainability and reduces unexpected runtime issues.

Does this R style guide align with Tidyverse API conventions?

The style guide incorporates Tidyverse API conventions to ensure R code interoperability. This alignment helps developers write scripts that integrate seamlessly with Tidyverse packages and maintain ecosystem consistency.

When should I consult an R style guide for refactoring existing code?

Use an R style guide during code refactoring to enforce object naming, file organization, and single responsibility principles. This ensures existing code meets quality standards and remains readable for collaborative development.