Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sdhutchins/documenteR

An RStudio addin to create skeleton roxygen2 documentation for functions & data.frames.
https://github.com/sdhutchins/documenteR

document documentation r roxygen roxygen-skeletons roxygen2

Last synced: about 2 months ago
JSON representation

An RStudio addin to create skeleton roxygen2 documentation for functions & data.frames.

Awesome Lists containing this project

README

        

[![Travis build status](https://travis-ci.org/sdhutchins/documenteR.svg?branch=master)](https://travis-ci.org/sdhutchins/documenteR)
[![Coverage status](https://codecov.io/gh/sdhutchins/documenteR/branch/master/graph/badge.svg)](https://codecov.io/github/sdhutchins/documenteR?branch=master)

# documenteR

An RStudio addin that builds the skeleton of documentation for an R function or dataframe using roxygen2 syntax.

This addin has been modified from [@mdlincoln](https://github.com/mdlincoln)'s [docthis](https://github.com/mdlincoln/docthis) to fit more with Hadley's [notes on documenting R packages](http://r-pkgs.had.co.nz/man.html).

## Installation

```r
devtools::install_github("sdhutchins/documenteR")
```

## Examples

IF you've witten a function but haven't created documentation for it, select the function tile, and call the "Document an object" addin, which will paste in skeleton roxygen2 documentation above your function definition:

### Document a function

```r
#' @title FUNCTION_TITLE
#'
#' @description FUNCTION_DESCRIPTION
#'
#' @param formula DESCRIPTION.
#' @param data DESCRIPTION.
#' @param subset DESCRIPTION.
#' @param weights DESCRIPTION.
#' @param na.action DESCRIPTION.
#' @param method DESCRIPTION.
#' @param model DESCRIPTION.
#' @param x DESCRIPTION.
#' @param y DESCRIPTION.
#' @param qr DESCRIPTION.
#' @param singular.ok DESCRIPTION.
#' @param contrasts DESCRIPTION.
#' @param offset DESCRIPTION.
#' @param ... DESCRIPTION.
#'
#' @return RETURN DESCRIPTION
#' @export
```

### Document a dataframe

This will also work for a `data.frame`, which you _should_ be thoroughly documenting in `R/data.R`.
Highlight the name of your `data.frame` and call the addin.

```r
#' DATASET_TITLE
#'
#' DATASET_DESCRIPTION
#'
#' @format A data frame with 150 rows and 5 variables:
#' \describe{
#' \item{\code{Sepal.Length}}{double. DESCRIPTION.}
#' \item{\code{Sepal.Width}}{double. DESCRIPTION.}
#' \item{\code{Petal.Length}}{double. DESCRIPTION.}
#' \item{\code{Petal.Width}}{double. DESCRIPTION.}
#' \item{\code{Species}}{integer. DESCRIPTION.}
#' }
"iris"
```