Generate comprehensive documentation from R codebases. This command uses the **r-docs-architect** agent to create roxygen2 documentation, README files, pkgdown sites, and architecture documentation.
Generates comprehensive R package documentation including roxygen2, README, pkgdown sites, and architecture diagrams.
/plugin marketplace add choxos/BiostatAgent/plugin install choxos-r-tidy-modeling-plugins-r-tidy-modeling@choxos/BiostatAgentGenerate comprehensive documentation from R codebases. This command uses the r-docs-architect agent to create roxygen2 documentation, README files, pkgdown sites, and architecture documentation.
Generate comprehensive documentation:
/r-doc-generate [path] [doc_type] [options]
path: Path to R package or project (default: current directory)doc_type: One of full, roxygen, readme, pkgdown, architecture (default: full)options: Comma-separated options (see below)full: Complete documentation suite
roxygen: Function documentation only
readme: README generation
pkgdown: Website configuration
architecture: Architecture documentation
overwrite: Overwrite existing docs (default: no)badges: Include badges in README (default: yes)examples: Generate examples (default: yes)vignettes: Create vignette templates (default: yes)output/
└── documentation/
├── man/ # roxygen2 generated docs
│ ├── function1.Rd
│ └── function2.Rd
├── README.md # Project README
├── _pkgdown.yml # pkgdown configuration
├── vignettes/
│ ├── getting-started.Rmd
│ └── advanced-usage.Rmd
└── architecture/
├── overview.md # System overview
└── diagrams/ # Mermaid/graphviz files
/r-doc-generate my_package full badges,vignettes
This generates complete documentation for my_package with badges and vignettes.
#' Function Title
#'
#' Detailed description of what the function does.
#'
#' @param x Description of parameter x.
#' @param y Description of parameter y.
#'
#' @return Description of return value.
#'
#' @examples
#' # Basic usage
#' result <- function_name(x = 1, y = 2)
#'
#' @export
#' @family related functions
#' @seealso [related_function()]
# Package Name
<!-- badges: start -->
[](badge-link)
[](badge-link)
<!-- badges: end -->
## Overview
Brief description of the package.
## Installation
```r
install.packages("pkg")
library(pkg)
# Basic example
## Generated Content
### Function Documentation
- Auto-detects parameter types
- Generates @return based on function body analysis
- Creates runnable @examples
- Adds appropriate @export tags
- Links related functions with @family
### README Components
- Dynamic badges based on CI configuration
- Installation for CRAN and GitHub
- Usage examples from package functions
- Documentation links
### pkgdown Configuration
- Organizes functions by topic
- Groups related articles
- Configures search
- Sets up navigation
### Architecture Diagrams
- Function dependency graphs
- Data flow diagrams
- Package structure visualization
- API endpoint mapping
## Integration
### With devtools
```r
# After generating docs
devtools::document()
devtools::check()
pkgdown::build_site()
Generated workflows include: