r-package-development

Guide R package development with best practices for testing, documentation, and structure.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/laurenoconnelllab/pTRAPPING --skill r-package-development-laurenoconnelllab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-package-development
Source: https://github.com/laurenoconnelllab/pTRAPPING/tree/main/.claude/skills/r-package-development
Command: npx skills add https://github.com/laurenoconnelllab/pTRAPPING --skill r-package-development-laurenoconnelllab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides comprehensive guidance for developing, validating, and documenting R packages, streamlining the workflow for authors and contributors.

Core Features & Use Cases

  • Dependency Management: Best practices for choosing and declaring dependencies.
  • API Design: Modern, tidyverse-friendly function patterns and input validation.
  • Testing & Documentation: Organizing unit tests, writing effective documentation, and maintaining code quality.
  • Package Structure: Recommended directory layout and release checklist.
  • Error Handling & Security: Strategies for user-friendly errors and safe coding practices.

Quick Start

Follow this guide to set up and structure your R package with best practices.

Frequently Asked Questions about r-package-development

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

FAQPage Schema
What's the best way to structure an R package for long-term maintenance?

The best way to structure an R package is to follow a recommended directory layout that organizes unit tests, documentation, and dependencies efficiently. This structure streamlines the workflow for authors and contributors while maintaining code quality.

How do I manage dependencies when developing an R package?

To manage dependencies during R package development, apply best practices for choosing and declaring dependencies in your package metadata. This ensures robust package development and prevents conflicts for users installing your package.

How do I write effective documentation for R package functions?

Writing effective R package documentation involves organizing function descriptions and maintaining modern API design patterns. This ensures users can easily understand and validate inputs according to tidyverse-friendly function conventions.

How should I handle error handling and safety considerations in R packages?

Error handling in R packages requires implementing strategies for user-friendly errors and safe coding practices. This ensures robust package development by anticipating edge cases and protecting users from unexpected failures.

How do I set up unit tests for an R package?

To set up unit tests for an R package, organize your testing scripts to validate function behavior and maintain code quality. This testing process is critical for ensuring package reliability before adding it to a release checklist.

Can I use tidyverse-friendly patterns for R package API design?

Yes, you can use tidyverse-friendly function patterns for R package API design. This approach includes modern input validation techniques to ensure your package interface is intuitive and robust for users.