Skip to contents

Make Your R Projects Reproducible, Organized, and Shareable

Let’s be honest, organizing projects in R can feel like herding cats. Code in one place, raw data scattered around, and don’t even get started on trying to remember exactly which versions of everything worked together. That’s where projr steps in to streamline your workflow.

What is projr?

Think of projr as your R project’s personal assistant. It helps you:

  • Set up a consistent structure: No more “Where should this file go?” dilemmas. projr guides you with a clear project layout.
  • Track changes: Code changes? Data updates? projr automatically versions your project, so you have a crystal-clear history.
  • Collaborate seamlessly: Sharing your work is a breeze with built-in tools for version control (we’ll take care of the tricky Git stuff for you!).

Why should I care?

  1. Reproducibility: Anyone (including your future self!) can easily rerun your analysis with all the right ingredients.
  2. Organization: A well-organized project is a happy project. Find what you need, when you need it.
  3. Collaboration: Work smoothly with others, knowing your project’s history and files are easily shared.

How does it work? (The Super-Simplified Version)

  1. Start a new project: projr_init() sets the stage with folders for your data, code, and results. It even connects to GitHub if you want.
  2. Build your project: projr_build_output() runs your code, keeps track of versions, and neatly packages everything up.

That’s the gist, but projr can do much more. It can automatically share your project on platforms like GitHub or store it locally – all customizable with a simple configuration file.

Ready to get started?

1. Install projr:

if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}
remotes::install_github("SATVILab/projr")
library(projr)

2. Open R in your desired project folder. (If you’re using RStudio, it’s easiest to start a new project right inside the folder.)

3. Initialize your project:

Follow the prompts, and projr will take care of the rest!

Building Your Project

Now it’s time to make your project come alive!

  • Test it out: Use projr_build_dev() to run your code and see how your results look. This is a great way to catch errors as you go.

  • Ready to share? Use projr_build_output() to create the final version of your project. This will automatically version everything, package it up nicely, and even share it on platforms like GitHub if you’ve set that up.

Where can I save my stuff?

projr has a special configuration file (_projr.yml) that tells it where to store your data, results, and the beautiful documents you create. You can customize this to fit your workflow perfectly.

Sound good? Let’s dive into the details in the next vignettes!