r-package-development

Guide R package development across dependencies, API design, testing, and documentation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

R package development often suffers from unclear dependency management, inconsistent API design, and sparse documentation, leading to brittle packages and long maintenance cycles.

Core Features & Use Cases

  • Guidelines for selecting dependencies and structuring DESCRIPTION and NAMESPACE files
  • Best practices for API design, function ergonomics, and export strategies
  • Testing, documentation with roxygen2, and release readiness
  • Use Case: starting a new package or auditing an existing project

Quick Start

Create or open an R package project and apply this guide to configure dependencies, API design, testing, and documentation scaffolding.

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 an R package for long-term maintenance?

Structuring an R package for maintenance requires configuring dependencies, API design, testing, and documentation scaffolding. This prevents brittle packages by ensuring consistent project structure, clear function ergonomics, and comprehensive roxygen2 documentation across the project lifecycle.

What's the best way to manage dependencies in an R package?

Managing R package dependencies involves selecting dependencies carefully and structuring the DESCRIPTION file properly. Clear dependency management prevents version conflicts and brittle packages, reducing long maintenance cycles during package development.

How do I document R functions using roxygen2?

Documenting R functions with roxygen2 involves writing inline documentation comments above function definitions to generate NAMESPACE and help files. This ensures release readiness and provides users with clear, accessible API documentation.

Does testthat work for testing R packages across the project lifecycle?

Yes, testthat works for testing R packages across the project lifecycle. It provides a testing framework to validate function ergonomics and API design choices, ensuring robust release readiness and preventing brittle package maintenance cycles.

When do I need to audit an existing R package project?

You need to audit an existing R package when facing unclear dependency management, inconsistent API design, or sparse documentation. Auditing dependencies, testing strategies, and roxygen2 practices resolves brittleness and reduces long maintenance cycles.

Why does R package API design affect function ergonomics?

R package API design affects function ergonomics because it dictates export strategies and how users interact with the package. Inconsistent API design leads to brittle packages, while clear ergonomics improve release readiness and maintainability.