r-package-refactor

Transform R scripts into structured packages with roxygen2 documentation and tests.

Updated Nov 8, 2024
One-click install
npx skills add https://github.com/cedanl/.github --skill r-package-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-package-refactor
Source: https://github.com/cedanl/.github/tree/main/.claude/skills/r-package-refactor
Command: npx skills add https://github.com/cedanl/.github --skill r-package-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Transforms messy R projects into properly structured R packages with namespaces, documentation, and best practices.

Core Features & Use Cases

  • Convert scripts into package functions with proper exports and documentation.
  • Enforce CEDA standards for structure, style, and conventions.
  • Add interactive Shiny app for guided usage.

Quick Start

Configure package name and repository type, then start Phase 1 discovery to begin refactoring.

Frequently Asked Questions about r-package-refactor

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

FAQPage Schema
How do I refactor an R project into a properly structured package?

Refactoring an R project into a package involves enforcing standard directory structures like R/, man/, and tests/, using roxygen2 for documentation, and defining namespace exports for your functions.

What does roxygen2 do when converting R scripts into package functions?

When converting R scripts into package functions, roxygen2 generates standardized documentation in the man/ directory and manages namespace exports directly from inline code comments.

Can I add a Shiny app during R package refactoring?

Yes, you can integrate a Shiny app during R package refactoring to provide guided usage and interactive functionality alongside the properly structured package codebase.

Does this R packaging approach enforce specific coding standards?

Yes, this R packaging approach enforces CEDA standards for structure, style, and conventions to ensure your refactored codebase meets standard-compliant packaging requirements.

What is the best way to start migrating disorganized R scripts to a package?

The best way to start migrating disorganized R scripts to a package is configuring the package name and repository type, then beginning Phase 1 discovery to analyze and restructure the codebase.

How do I add testing to an R package during refactoring?

You add testing to an R package during refactoring by enforcing a tests/ directory structure and integrating test suites that validate the newly converted package functions.