Package reproducibility is a very common issue in reproducing some R code. When various packages get updated, some interconnections between them may break. The ideal solution for the problem is to reproduce the image of the R code writer's machine on your computer at the date when the code was written. And here comes checkpoint
package.
Starting from 2014-09-17, the authors of the package make daily copies of the whole CRAN package repository to their own mirror repository -- Microsoft R Archived Network. So, to avoid package reproduciblity issues when creating a reproducible R project, all you need is to:
checkpoint::checkpoint('YYYY-MM-DD')
line in your code.checkpoint
will create a directory .checkpoint
in your R_home directory ("~/"
). To this technical directory it will install all the packages, that are used in your project. That means, checkpoint
looks through all the .R
files in your project directory to pick up all the library()
or require()
calls and install all the required packages in the form they existed at CRAN on the specified date.
PRO You are freed from the package reproducibility issue.
CONTRA For each specified date you have to download and install all the packages that are used in a certain project that you aim to reproduce. That may take quite a while.