Skip to content

Commit 88171fe

Browse files
committed
Update README.md
1 parent 5fabdac commit 88171fe

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

README.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,51 @@
1-
# checkpoint - Install packages from snapshots on the checkpoint server for reproducibility
1+
# checkpoint - Simple reproducibility for R scripts that depend on packages
22

33
## Overview
44

55
The goal of `checkpoint` is to solve the problem of package reproducibility in R. Specifically, `checkpoint` solve the problems that occur when you don't have the correct versions of R packages. Since packages get updated on CRAN all the time, it can be difficult to recreate an environment where all your packages are consistent with some earlier state.
66

7-
To solve this, `checkpoint` allows you to install package from a specific snapshot date. In other words, `checkpoint` makes it possible to install packages from a specific date in the past, as if you had a CRAN time machine.
7+
To solve this, `checkpoint` allows you to install packages from a specific snapshot date. In other words, `checkpoint` makes it possible to install package versions from a specific date in the past, as if you had a CRAN time machine.
88

9-
To achieve reproducibility, once a day we create a complete snapshot of CRAN, on the "Managed R archived network" (MRAN) server. At midnight (UTC) MRAN mirrors all of CRAN and saves a snapshot. This allows you to install packages from a snapshot date, thus "going back in time" to this date, by installing packages as they were at that snapshot date.
109

10+
### Checkpoint Features
1111

12-
Together, the `checkpoint` package and the MRAN server act as a CRAN time machine. The `checkpoint()` function installs the packages to a local library exactly as they were at the specified point in time. Only those packages are available to your session, thereby avoiding any package updates that came later and may have altered your results. In this way, anyone using `checkpoint()` can ensure the reproducibility of your scripts or projects at any time.
12+
With the `checkpoint` package, you can easily:
1313

14+
* Write R scripts or projects using package versions from a specific point in time;
15+
* Write R scripts that use older versions of packages, or packages that are no longer available on CRAN;
16+
* Install packages (or package versions) visible only to a specific project, without affecting other R projects or R users on the same system;
17+
* Manage multiple projects that use different package versions;
18+
* Share R scripts with others that will automatically install the appropriate package versions;
19+
* Write and share code R whose results can be reproduced, even if new (and possibly incompatible) package versions are released later.
1420

21+
## Using the checkpoint function
1522

1623
Using `checkpoint` is simple:
1724

18-
- `checkpoint` has only a single function, `checkpoint()` where you specify the snapshot date.
25+
- The `checkpoint` package has only a single function, `checkpoint()` where you specify the snapshot date.
26+
- Example: `checkpoint("2015-01-15")` instructs R to install and use only package versions that existed on January 15, 2015.
1927

20-
## Using the checkpoint function
28+
To write R code for reproducibility, simply begin your master R script as follows:
29+
30+
```R
31+
library(checkpoint)
32+
checkpoint("2015-01-15") ## or any date in YYYY-MM-DD format after 2014-09-17
33+
```
34+
35+
Choose a snapshot date that includes the package versions you need for your script (or today's date, to get the latest versions). Any package version published since September 17, 2014 is available for use.
36+
37+
### Sharing your scripts for reproducibility
38+
39+
Sharing your R analysis reproducibly can be as easy as emailing a single R script. Begin your script with the following commands:
40+
41+
42+
- Load the `checkpoint` package using `library(checkpoint)`
43+
- Ensure you specify `checkpoint()` with your checkpoint date, e.g. `checkpoint("2014-10-01")`
44+
45+
Then send this script to your collaborators. When they run this script on their machine, `checkpoint` will perform the same steps of installing the necessary packages, creating the `checkpoint` snapshot folder and producing the same results.
46+
47+
48+
## How checkpoint works
2149

2250
When you create a checkpoint, the `checkpoint()` function performs the following:
2351

@@ -28,20 +56,20 @@ When you create a checkpoint, the `checkpoint()` function performs the following
2856

2957
This means the remainder of your script will run with the packages from a specific date.
3058

59+
### Where `checkpoint` finds historic package versions
3160

32-
## Sharing your scripts for reproducibility
61+
To achieve reproducibility, once a day we create a complete snapshot of CRAN, on the "Managed R archived network" (MRAN) server. At midnight (UTC) MRAN mirrors all of CRAN and saves a snapshot. (MRAN has been storing daily snapshots since September 17, 2014.) This allows you to install packages from a snapshot date, thus "going back in time" to this date, by installing packages as they were at that snapshot date.
62+
63+
64+
Together, the `checkpoint` package and the MRAN server act as a CRAN time machine. The `checkpoint()` function installs the packages to a local library exactly as they were at the specified point in time. Only those packages are available to your session, thereby avoiding any package updates that came later and may have altered your results. In this way, anyone using `checkpoint()` can ensure the reproducibility of your scripts or projects at any time.
3365

34-
Sharing your script to be reproducible is as easy as:
3566

36-
- Load the `checkpoint` package using `library(checkpoint)`
37-
- Ensure you specify `checkpoint()` with your checkpoint date, e.g. `checkpoint("2014-10-01")`
3867

39-
Then send this script to your collaborators. When they run this script on their machine, `checkpoint` will perform the same steps of installing the necessary packages, creating the `checkpoint` snapshot folder and producing the same results.
4068

4169

4270
## Resetting the checkpoint
4371

44-
To reset the checkpoint, simply restart your R session.
72+
To revert to your default CRAN mirror and access globally-installed packages, simply restart your R session.
4573

4674

4775

0 commit comments

Comments
 (0)