r-documentation

Generate and manipulate R package documentation with roxygen2 and Rd format.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/jjjermiah/dotagents --skill r-documentation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-documentation
Source: https://github.com/jjjermiah/dotagents/tree/main/src/dot-agents/skills/r-documentation
Command: npx skills add https://github.com/jjjermiah/dotagents --skill r-documentation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation and management of R package documentation, ensuring clarity and correctness for your R functions and datasets.

Core Features & Use Cases

  • Roxygen2 Syntax: Understand and apply roxygen2 comment blocks for automatic documentation generation.
  • Mathematical Notation: Correctly embed LaTeX-style mathematical formulas using \eqn{} and \deqn{} with proper ASCII fallbacks.
  • Rd File Parsing: Programmatically inspect and extract information from generated .Rd files.
  • Use Case: You've written a complex statistical function in R and need to document its parameters, return values, and include a mathematical formula for its underlying theory in the help page.

Quick Start

Use the r-documentation skill to write roxygen2 comments for a new R function.

Frequently Asked Questions about r-documentation

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

FAQPage Schema
How do I write roxygen2 comments to generate R package documentation?

Roxygen2 comments generate R package documentation by parsing structured comment blocks above your functions to automatically create `.Rd` files. You define parameters, return values, and descriptions directly in the code, ensuring your help pages stay synchronized with your function definitions.

How do I add LaTeX math formulas to R documentation files?

LaTeX math formulas are added to R documentation using `\eqn{}` for inline equations and `\deqn{}` for displayed equations. You provide both the LaTeX notation and a plain ASCII fallback so the help page renders correctly across different output formats.

What is the best way to extract structured information from Rd files?

Extracting structured information from `.Rd` files is best handled by programmatically parsing the generated documentation. This approach allows you to inspect specific documentation sections, validate parameter definitions, and analyze help page content systematically.

Does roxygen2 support documenting complex statistical functions with mathematical notation?

Roxygen2 supports documenting complex statistical functions by combining standard parameter descriptions with mathematical notation. You can use `\eqn{}` and `\deqn{}` within your comment blocks to embed the underlying theoretical formulas directly into the generated help page.

When do I need to provide ASCII fallbacks for mathematical notation in R documentation?

ASCII fallbacks for mathematical notation are needed when rendering R documentation in environments that lack full LaTeX support. Providing an ASCII alternative inside `\eqn{}` or `\deqn{}` ensures your equations remain readable and accessible across all text display interfaces.