You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-12Lines changed: 40 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
2
2
3
3
## Overview
4
4
5
5
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.
6
6
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.
8
8
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.
10
9
10
+
### Checkpoint Features
11
11
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:
13
13
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.
14
20
21
+
## Using the checkpoint function
15
22
16
23
Using `checkpoint` is simple:
17
24
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.
19
27
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
21
49
22
50
When you create a checkpoint, the `checkpoint()` function performs the following:
23
51
@@ -28,20 +56,20 @@ When you create a checkpoint, the `checkpoint()` function performs the following
28
56
29
57
This means the remainder of your script will run with the packages from a specific date.
30
58
59
+
### Where `checkpoint` finds historic package versions
31
60
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.
33
65
34
-
Sharing your script to be reproducible is as easy as:
35
66
36
-
- Load the `checkpoint` package using `library(checkpoint)`
37
-
- Ensure you specify `checkpoint()` with your checkpoint date, e.g. `checkpoint("2014-10-01")`
38
67
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.
40
68
41
69
42
70
## Resetting the checkpoint
43
71
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.
0 commit comments