Last updated: 2026-02-06
Minimal R documentation generator - base R only, no magic.
What it does
tinyrox is a lightweight alternative to roxygen2 that generates valid .Rd files and NAMESPACE from #' comments using only base R.
Installation
1remotes::install_github("cornball-ai/tinyrox")
Usage
1library(tinyrox)
2
3# Generate man/*.Rd and NAMESPACE from R/*.R
4document()
5
6# Clean generated files (man/, NAMESPACE)
7clean()
8
9# Check for common CRAN policy issues
10check_cran()
Supported Tags
Documentation
| Tag | Purpose |
|---|---|
@title | One-line title |
@description | Short description |
@details | Longer description |
@param name | Parameter documentation |
@return | Return value |
@value | Alias for @return |
@examples | Code examples (verbatim) |
@example path | Include example from file |
@seealso | Cross-references |
@references | Citations |
@section Title: | Custom section |
@author | Author information |
@family name | Related functions |
@aliases | Additional topic aliases |
@keywords | Rd keywords (e.g., internal) |
@name | Explicit topic name |
@inheritParams fn | Copy params from another function |
@noRd | Skip Rd generation |
Namespace
| Tag | Effect |
|---|---|
@export | export() |
@exportS3Method generic class | S3method() |
@import pkg | import() |
@importFrom pkg sym1 sym2 | importFrom() |
@useDynLib pkg | useDynLib() |
Example
1#' Add Two Numbers
2#'
3#' @param x First number
4#' @param y Second number
5#' @return The sum
6#' @export
7#'
8#' @examples
9#' add(1, 2)
10add <- function(x, y) {
11 x + y
12}
CRAN Compliance Checking
tinyrox includes automated CRAN compliance checks:
1# Check DESCRIPTION for common issues
2check_description_cran()
3# Warns about: unquoted package names, missing web service links
4
5# Check R code for CRAN policy violations
6check_code_cran()
7# Warns about: T/F, print()/cat(), .GlobalEnv, installed.packages(), etc.
8
9# Run all checks
10check_cran()
11
12# Auto-fix DESCRIPTION quoting issues
13fix_description_cran()
Issues detected:
- Unquoted package/software names in Title/Description
- Missing web service links for packages like hfhub, gh
T/Finstead ofTRUE/FALSEprint()/cat()instead ofmessage()installed.packages()usage.GlobalEnvmodificationssetwd()withouton.exit()restoration- Hardcoded
set.seed()without parameter
Philosophy
tinyrox follows the tinyverse philosophy:
Dependencies have real costs. Each dependency is an invitation to break your project.
Design principles:
- Minimize dependencies (tinyrox has none)
- Explicit over implicit - no inference magic
- Strict subset of tags - not everything roxygen2 does
- Deterministic output - same input = same output
- Fail fast on unknown tags
What tinyrox does NOT do:
- Markdown parsing
- Automatic dependency inference
@rdnamegrouping magic- pkgdown integration
Development Workflow
tinyrox is part of the tinyverse toolchain for R package development:
| Package | Purpose |
|---|---|
| tinyrox | Documentation & NAMESPACE |
| tinypkgr | install, load_all, check, build |
| tinytest | Unit testing |
| fyi | Rd to markdown (LLM context, static sites) |
1# Edit R/*.R files with #' comments
2
3# Regenerate docs
4tinyrox::document()
5
6# Load for interactive development (no install)
7tinypkgr::load_all()
8
9# Install and reload in current session
10tinypkgr::reload()
11tinytest::test_package("mypkg")
12
13# Full R CMD check
14tinypkgr::check()
Or from the command line with littler:
1r -e 'tinyrox::document(); tinypkgr::install(); tinytest::test_package("mypkg")'
License
GPL-3
Reference
See Function Reference for complete API documentation.
Functions
tinyrox Reference
Function reference for tinyrox