R Code Patterns for Packages

Community

Write robust R package code.

Authorchoxos
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses common pitfalls and best practices in R package development, ensuring code is robust, maintainable, and adheres to R's ecosystem standards.

Core Features & Use Cases

  • Namespace Management: Guides on using pkg::fun() and @importFrom to manage dependencies correctly.
  • Code Restrictions: Details forbidden functions (library(), source(), :::) and explains why they should be avoided in package code.
  • State Management: Provides patterns for handling global state, options, and environments safely.
  • Build vs. Load Time: Clarifies what code executes during package build versus when a user loads the package.
  • Use Case: A developer is unsure how to properly import functions from other R packages into their own package. This skill provides clear examples and explanations on using explicit namespace calls and @importFrom directives.

Quick Start

Follow the guidelines in this skill to correctly manage R package code and avoid common errors.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: R Code Patterns for Packages
Download link: https://github.com/choxos/RPkgAgent/archive/main.zip#r-code-patterns-for-packages

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.