r-package-development

Standardize R package development with roxygen2 documentation and testthat tests.

189|26|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/ab604/claude-code-r-skills --skill r-package-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-package-development
Source: https://github.com/ab604/claude-code-r-skills/tree/main/.claude/skills/r-package-development
Command: npx skills add https://github.com/ab604/claude-code-r-skills --skill r-package-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured guide for building robust R packages, detailing dependencies, API design, testing, and documentation to standardize development practices across projects.

Core Features & Use Cases

  • Dependency and tooling guidance for managing DESCRIPTION and NAMESPACE, ensuring reproducible builds.
  • API design and testing guidelines leveraging roxygen2 and testthat for stable, well-documented interfaces.
  • Documentation and maintenance strategies, including examples and vignettes to support long-term project health.
  • Use Case: Starting a new R package, follow this guide to scaffold a well-organized package with roxygen2 docs and tests.

Quick Start

Review the r-package-development skill to understand recommended project structure, then create a new package with DESCRIPTION, NAMESPACE, and an R/ directory containing roxygen2 documentation and tests.

Frequently Asked Questions about r-package-development

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

FAQPage Schema
How do I structure a new R package with roxygen2 documentation and testthat tests?

To structure a new R package, scaffold a root directory containing DESCRIPTION, NAMESPACE, and an R/ folder. Use roxygen2 for inline documentation and testthat to implement testing schemas, ensuring reproducible builds and maintainable code.

What are the required fields for managing dependencies in an R package DESCRIPTION file?

Managing dependencies in an R package DESCRIPTION file requires specifying package names and version requirements. This Skill enforces concrete requirements for DESCRIPTION fields to ensure robust dependency tracking and reproducible builds across different environments.

How does NAMESPACE export management work with roxygen2 for R package API design?

NAMESPACE export management with roxygen2 uses inline tags to define exported functions. This approach standardizes API design by automatically generating NAMESPACE directives, ensuring stable and well-documented interfaces for your R package.

What is the best way to document R package functions using examples and vignettes?

The best way to document R package functions is using roxygen2 tags for examples and creating vignettes for broader usage guides. This ensures long-term project health by providing comprehensive, maintainable documentation for users.

Can I use this workflow to standardize API design and testing for existing R packages?

Yes, you can apply this workflow to existing R packages to standardize API design and testing. It guides updates to project structure, roxygen2 documentation, testthat tests, and DESCRIPTION management for better maintainability.

Why do I need to standardize R package development across different projects?

Standardizing R package development solves the problem of inconsistent project structures and documentation. By detailing dependencies, API design, testing, and documentation, it enforces concrete requirements that ensure robust, reproducible builds across all projects.