Created
October 8, 2014 09:09
-
-
Save andrie/a5e0fc0a4061081adbbd to your computer and use it in GitHub Desktop.
Worked example of checkpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create temporary project and set working directory | |
example_project <- paste0("~/checkpoint_example_project_", Sys.Date()) | |
dir.create(example_project, recursive = TRUE) | |
oldwd <- setwd(example_project) | |
# Write dummy code file to project | |
cat("library(MASS)", "library(foreach)", | |
sep="\n", | |
file="checkpoint_example_code.R") | |
# Create a checkpoint by specifying a snapshot date | |
library(checkpoint) | |
checkpoint("2014-09-17") | |
# Check that CRAN mirror is set to MRAN snapshot | |
getOption("repos") | |
# Check that library path is set to ~/.checkpoint | |
.libPaths() | |
# Check which packages are installed in checkpoint library | |
installed.packages() | |
# cleanup | |
unlink(example_project, recursive = TRUE) | |
setwd(oldwd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment