roxygen2

Generate R package documentation from inline R comments

https://github.com/r-lib/roxygen2

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    13 of 120 committers (10.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary

Keywords

devtools documentation r

Keywords from Contributors

documentation-tool visualisation package-creation rmarkdown tidy-data unit-testing setup data-manipulation grammar latex
Last synced: 6 months ago · JSON representation

Repository

Generate R package documentation from inline R comments

Basic Info
Statistics
  • Stars: 618
  • Watchers: 18
  • Forks: 235
  • Open Issues: 178
  • Releases: 27
Topics
devtools documentation r
Created almost 15 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License Code of conduct Support

README.md

roxygen2 roxygen2 website

CRAN status R-CMD-check Codecov test coverage <!-- badges: end -->

The premise of roxygen2 is simple: describe your functions in comments next to their definitions and roxygen2 will process your source code and comments to automatically generate .Rd files in man/, NAMESPACE, and, if needed, the Collate field in DESCRIPTION.

Installation

```R

Install roxygen2 from CRAN

install.packages("roxygen2")

Or the development version from GitHub:

install.packages("pak")

pak::pak("r-lib/roxygen2") ```

Usage

The premise of roxygen2 is simple: describe your functions in comments next to their definitions and roxygen2 will process your source code and comments to produce Rd files in the man/ directory. Here's a simple example from the stringr package:

```R

' The length of a string

'

' Technically this returns the number of "code points", in a string. One

' code point usually corresponds to one character, but not always. For example,

' an u with a umlaut might be represented as a single character or as the

' combination a u and an umlaut.

'

' @inheritParams str_detect

' @return A numeric vector giving number of characters (code points) in each

' element of the character vector. Missing string have missing length.

' @seealso [stringi::stri_length()] which this function wraps.

' @export

' @examples

' str_length(letters)

' str_length(NA)

' str_length(factor("abc"))

' str_length(c("i", "like", "programming", NA))

str_length <- function(string) { } ```

When you roxygenise() (or devtools::document()) your package these comments will be automatically transformed to the .Rd that R uses to generate the documentation you see when you type ?str_length.

Learn more

To get started, first read vignette("roxygen2"). Then read more about the specific package component that you want to generate:

  • Start with vignette("rd") to learn how document your functions with roxygen2.

  • vignette("rd-other") discusses how to document other things like datasets, the package itself, and the various pieces used by R's OOP systems.

  • vignette("rd-formatting") gives the details of roxygen2's rmarkdown support.

  • vignette("reuse") demonstrates the tools available to reuse documentation in multiple places.

  • vignette("namespace") describes how to generate a NAMESPACE file, how namespacing works in R, and how you can use roxygen2 to be specific about what your package needs and supplies.

  • For the Collate field in the DESCRIPTION, see ?update_collate().

Owner

  • Name: R infrastructure
  • Login: r-lib
  • Kind: organization

GitHub Events

Total
  • Create event: 1
  • Release event: 1
  • Issues event: 34
  • Watch event: 24
  • Issue comment event: 48
  • Push event: 8
  • Pull request review event: 1
  • Pull request event: 17
  • Fork event: 6
Last Year
  • Create event: 1
  • Release event: 1
  • Issues event: 34
  • Watch event: 24
  • Issue comment event: 48
  • Push event: 8
  • Pull request review event: 1
  • Pull request event: 17
  • Fork event: 6

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 2,497
  • Total Committers: 120
  • Avg Commits per committer: 20.808
  • Development Distribution Score (DDS): 0.491
Past Year
  • Commits: 13
  • Committers: 11
  • Avg Commits per committer: 1.182
  • Development Distribution Score (DDS): 0.769
Top Committers
Name Email Commits
hadley h****m@g****m 1,270
pcd p****d@e****b 442
Peter Danenberg p****d@r****g 238
Gábor Csárdi c****r@g****m 108
Kirill Müller k****r@i****h 86
manuel m****l@e****b 39
Yihui Xie x****e@y****e 27
Jim Hester j****r@g****m 23
Kirill Müller k****r 22
Brian Danielak b****k@u****u 15
Manuel J. A. Eugster M****r@s****e 15
Michael Chirico m****4@g****m 10
Kevin Ushey k****y@g****m 9
Geoff99 g****9@g****m 7
dougmitarotonda d****a@g****m 7
Maëlle Salmon m****n@y****e 6
Will Beasley w****y@h****m 6
Max Held i****o@m****e 6
Jennifer (Jenny) Bryan j****n@g****m 6
Johannes Ranke j****e@u****e 6
Salim B s****m@p****e 5
Andy Teucher a****r@g****m 5
James Manton a****n@g****m 5
Lionel Henry l****y@g****m 5
olivroy 5****y 5
danielinteractive d****e@i****h 4
Eugene Ha e****a@p****e 3
Mara Averick m****k@g****m 3
Thomas Lin Pedersen t****5@g****m 3
Davis Vaughan d****s@p****o 3
and 90 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 242
  • Total pull requests: 149
  • Average time to close issues: 7 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 145
  • Total pull request authors: 38
  • Average comments per issue: 1.95
  • Average comments per pull request: 1.34
  • Merged pull requests: 99
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 49
  • Pull requests: 25
  • Average time to close issues: about 5 hours
  • Average time to close pull requests: 3 months
  • Issue authors: 33
  • Pull request authors: 9
  • Average comments per issue: 0.08
  • Average comments per pull request: 0.32
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hadley (26)
  • MichaelChirico (24)
  • olivroy (6)
  • maelle (5)
  • DavisVaughan (4)
  • lionel- (4)
  • krlmlr (3)
  • moodymudskipper (3)
  • ramiromagno (3)
  • ateucher (3)
  • jeroen (3)
  • dmurdoch (3)
  • llrs (3)
  • sebffischer (3)
  • klmr (3)
Pull Request Authors
  • hadley (36)
  • MichaelChirico (24)
  • olivroy (13)
  • krlmlr (11)
  • salim-b (6)
  • DavisVaughan (5)
  • gaborcsardi (5)
  • m-muecke (4)
  • maxheld83 (3)
  • ateucher (3)
  • romainfrancois (2)
  • arilamstein (2)
  • maelle (2)
  • tommarshall2 (2)
  • HenrikBengtsson (2)
Top Labels
Issue Labels
feature (30) rd :writing_hand: (22) bug (22) R6 :six: (12) documentation (10) namespace :woman_astronaut: (6) upkeep (5) markdown :arrow_down: (4) reprex (3) inherit :family_man_woman_girl_boy: (2) help wanted :heart: (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 146,248 last-month
  • Total docker downloads: 47,574,598
  • Total dependent packages: 494
    (may contain duplicates)
  • Total dependent repositories: 1,433
    (may contain duplicates)
  • Total versions: 58
  • Total maintainers: 1
cran.r-project.org: roxygen2

In-Line Documentation for R

  • Versions: 32
  • Dependent Packages: 494
  • Dependent Repositories: 1,433
  • Downloads: 146,248 Last month
  • Docker Downloads: 47,574,598
Rankings
Dependent packages count: 0.2%
Forks count: 0.2%
Dependent repos count: 0.3%
Stargazers count: 0.6%
Downloads: 0.8%
Average: 3.2%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/r-lib/roxygen2
  • Versions: 26
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.3 depends
  • R6 >= 2.1.2 imports
  • brew * imports
  • cli >= 3.3.0 imports
  • commonmark * imports
  • desc >= 1.2.0 imports
  • digest * imports
  • knitr * imports
  • methods * imports
  • pkgload >= 1.0.2 imports
  • purrr >= 0.3.3 imports
  • rlang >= 1.0.0 imports
  • stringi * imports
  • stringr >= 1.0.0 imports
  • utils * imports
  • withr * imports
  • xml2 * imports
  • R.methodsS3 * suggests
  • R.oo * suggests
  • covr * suggests
  • rmarkdown * suggests
  • testthat >= 3.1.2 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite