Skip to content
andrie edited this page Oct 3, 2014 · 28 revisions

checkpoint

Part of the Reproducible R Toolkit:

Examples

Create a checkpoint project

Create a folder that you want your project in, OR go to a folder you already have a project in. Let's say the folder is called ~/myproject. Then run:

checkpoint(snapshotdate = "2014-09-17")

You should now have a RRT repository

Refresh repository

To update the packages in the project, simply run checkpoint() again().

checkpoint(snapshotdate = "2014-09-17")

Use cases

Use case 1: Start from scratch

Initialize an RRT repository (note that by default RRT functions work from the current working directory)

checkpoint(snapshotdate = "2014-07-11")

Write some code, for example you may put the following code into a file called code.R

library(ggplot2)
ggplot(mtcars, aes(mpg, cyl)) +
  geom_point()

Then you can refresh the RRT repo. No need to pass in the snapshotdate parameter again, just call checkpoint() with no parameters.

checkpoint()

Refreshing the repo looks for any new packages used in your code, and downloads those to your repository.

Use case 2: You already have some work done

In this use case, you've already written some code and you want to make your work an RRT repository.

You still need to initialize the repository using checkpoint(). After initializing, if you make additional changes, remember to run checkpoint() again to pick up any code changes.

Clone this wiki locally