library(knitr)
opts_chunk$set(echo = TRUE,
               message = FALSE,
               warning = FALSE)

We choose a checkpoint date for an earlier version of MASS than the current version (‘7.3.45’). Then we have a package test that checks to see if the version of MASS used here is the earlier version and not the current version.

# This will scan the Rmd file to identify the packages used within, and 
# get the source of the package and store it locally. In order to knit this doc, I had to install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com")
library(checkpoint)
checkpoint("2015-01-10", 
           auto.install.knitr = TRUE,
           use.knitr = TRUE, 
           checkpointLocation = "../packages")
library(MASS)

plot(crabs)
# check wd
getwd()
# check repos
getOption("repos")
# check libsS
.libPaths()
# check pkgs
installed.packages()[, "Package"]
# version of MASS, current is ‘7.3.45’, this should be earlier. 
packageVersion("MASS")


benmarwick/checkpointtest documentation built on May 12, 2019, 1:02 p.m.