

And you can call mypackage::a_function() now, or just a_function() after library(myfunction). Then, you run devtools::document(), which will update NAMESPACE and create help files in, e.g., man/a_function.Rd.

#' The thing that comes out of this function For instance: #' Short description of what this does The easiest, best, and most foolproof way to generate this file is using special comments before each function/variable you want to export.

The NAMESPACE file tells R which things you want to export as part of the package’s namespace. word-intitial VOTs from a number of sourcesīy default, all the functions and variables that are created in your package are private and not added to the global environment when you attach the package with library().F1, F2, and F3 distributions from Heald and Nusbaum (2015, PLoS).hVd F1 and F2 from the Nationwide Speech Project.I’ve also compiled a few packages based on donated data to streamline my own workflow, some of which the originators of the data have generously agreed to release publicly: If you want a sense of how this might work IRL, the example is based on this data package, which I’ve used for a couple of papers/presentations: The Github repository includes the Rmd source, and an example of how I’ve refactored an analysis along these lines, starting from an RMarkdown + CSV and ending up with an RMarkdown + a package. Or install with devtools::install() and then library().Load package with devtools::load_all() to access data.Put data preprocessing script into data-raw/, which reads in raw data and at calls devtools::use_data() to save.devtools::use_data_raw() and move raw data into data-raw/.devtools::create() the package skeleton.There are lots of good reasons why you should (reproducibility, convenience, sharing, documenting). Devtools makes it surprisingly easy to make a data package.
