Introduction to prodigenr

Luke W. Johnston

2016-05-13

Are you an academic researcher who often writes up abstracts for conferences or submits manuscripts to journals? Do you often have to make slides or posters for presentations? Is your usual workflow to copy a previous project and start replacing the old text for the new text? This R package was designed with you in mind!

prodigenr, or project directory generator, simplifies the process of creating these new projects and can help make your workflow more reproducible. Standard files and folders are created for specific projects (e.g. abstracts or manuscripts), along with a workflow that tries to be simple and easy to use.

Because researchers often write or create many papers, slides, posters, and abstracts, it can quickly become tedious and messy to always make a new directory with all the necessary files and organization.

The main command: prodigen

To use prodigenr, you simply need to use the prodigen command. At present, there are only four template projects that you can view using:

library(prodigenr)
list_templates()
## [1] "abstract"   "manuscript" "poster"     "slides"

These templates are projects that an academic researcher typically encounters. However, if you have a suggestion or want to add a template, please create a Github issue or submit a Pull Request!

Starting a manuscript? Create a project directory like so:

prodigen('manuscript', 'ManuscriptName', '~/path/to/new/project')

Do you use Git? You can start a git repository in the new project simply through the git.init argument:

prodigen('manuscript', 'ManuscriptName', '~/path/to/new/project', git.init = TRUE)

Or if you need to use Packrat, start it with packrat.init:

prodigen('manuscript', 'ManuscriptName', '~/path/to/new/project', packrat.init = TRUE)

The same procedure is used for making the other project templates.

prodigen('slides', 'PresentationName', '~/path')
prodigen('abstract', 'Name', '.') # Current directory

A README.md file is contained within each project that explains more about what each folder does and what some of the files do that were created.

The end goal of each project is to be as self contained as possible. So that if you ever need to go back to the analysis, it is easy to re-run the code and get the results that you say you got. This is especially useful if others such as reviewers ask for something or want to confirm your results. For more information on good practices to use in making an analysis project, see here or here)

Workflow when using projects created from prodigenr

A typical workflow would be to:

  1. Write up your analysis and associated written explanations of the results, as you would for any research project, in the abstract, poster, slides, or manuscript .Rmd (R Markdown) file.
  2. Any piece of code you use more than once or is fairly complex, convert it into a function. Put this new function into the R/functions.R file.
  3. Fetch and wrangle your data in the R/fetch_data.R and to use the data, load it using load_data().
  4. Knit the .Rmd file. You now have your final abstract, poster, slides, or manuscript to use for your research.