Site icon R-bloggers

New R package: packagedocs

[This article was first published on Ryan Hafen, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I’m pleased to announce the CRAN release of packagedocs which provides a mechanism for simple generation and automated deployment of nice-looking online R package documentation that plugs into the traditional R package vignette system.

< !--more-->

You can see some examples of documentation generated with packagedocs here, here, and here.

A feature list and usage guide is provided below, but it’s probably easiest to get a feel for what the package does by watching this short screencast:

Brief History

packagedocs has been around in one form or another for quite some time and is a successor of, heavily influenced by, and borrows from Hadley Wickham’s staticdocs package. packagedocs was conceived from the desire to have a package’s vignettes and function reference all rendered into a single website with several features for convenience and utility which I’ll list below. We’ve been using it for a few years to render the documentation for packages in our DeltaRho project. Recently Barret Schloerke jumped in and revamped the package to improve and add several features and get it ready to release on CRAN. I didn’t realize until writing this post that staticdocs, which has been relatively dormant for the past few years, is now being actively revamped, and is now known as pkgdown, also worth checking out.

Features

Here are some of the features of the package:

Installation

From CRAN:

install.packages("packagedocs")

From Github:

devtools::install_github("hafen/packagedocs")

Usage

There are three main functions.

To initialize your packagedocs documentation:

# in current package directory
packagedocs::init_vignettes()

This will create some files in your package’s "vignettes" directory. Edit "vignettes/docs.Rmd” and to generate your vignettes, run:

packagedocs::build_vignettes()

To set up your repository to automatically build and deploy to your github pages branch on every commit:

packagedocs::use_travis()

More detail about how to use the package is found in the package’s documentation, generated of course using packagedocs!

To leave a comment for the author, please follow the link and comment on their blog: Ryan Hafen.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.