Skip to contents

An R package containing an RStudio Addin to help you insert R Documentation (Rd) markup to your package’s function documentation.

You put a snorkel in your mouth to help you breathe oxygen; you put a {snorkel} in your Addins to help you prepare documentation with {roxygen2}.

Install

Install from Github with:

install.packages("remotes")  # if not already installed
remotes::install_github("matt-dray/snorkel")

Use

To use the Addin:

  1. Select some text in your function documentation to which you’d like to apply Rd markup (e.g. bold, italics), or place the cursor where you’d like to insert an Rd skeleton (i.e. the functions that insert lists)
  2. Click the ‘RStudio Addins’ dropdown at the top of the RStudio IDE
  3. Scroll/search for ‘SNORKEL’ and click the function you want

For speed, you can also search for the functions from the RStudio command palette or create custom RStudio keyboard shortcuts.

So, for example, you could highlight the word bold in #' This is bold and select the ‘Format Bold’ function from the Addin, resulting in #' This is \strong{bold}.

Special cases are ‘Link To Function (Another Package)’ and ‘Link To Function (Another Package, Show Name)’. Both need as input the package name and the function name that you’re linking to, which you should supply in the form ‘package::function’.

Help

For help with {snorkel} functions, take a look at the reference page on the package website, or in your R console type ? followed by the function name for its documentation.

Demo

Gif of RStudio Addin being used to add roxygen2 tags to selected text in the documentation for a function. Addins used are: format as bold, link to function in another package, and make hyperlink.

Code of Conduct

Please note that the {snorkel} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.