RevolutionAnalytics / checkpoint

Install R packages from snapshots on checkpoint-server
164 stars 38 forks source link

Dealing with packages not in CRAN? #269

Closed benwhalley closed 6 years ago

benwhalley commented 6 years ago

Apologies if this is in the docs, but I can't work out how to use packages via devtools which are not in can. So, for example:

chpt <- checkpoint::checkpoint("2018-05-01")
library(rstanarm)
if (!require(tidybayes)){
  devtools::install_github('mjskay/tidybayes')
}

Knitting an Rmd with this always fails because tidybayes is not installed into the checkpoint library (I think)

sfweller commented 6 years ago

The 'checkpoint' library is designed to work with package snapshots of CRAN packages. R packages located on GitHub won't work.

benwhalley commented 6 years ago

Is that by design, or would it be considered a bug? I can see that you might not want to complicate checkpoint in terms of using git as a separate snapshot system and trying to find commits at the checkpoint census date etc, but it would be nice if one could provide a github commit for packages that weren't in CRAN.

revodavid commented 6 years ago

You can install packages from a specific commit with install_github(,...ref="",...). I often do this for reproducibility when using checkpoint with GitHub packages. You just need to find the commit tag for the version you want to install.

benwhalley commented 6 years ago

Many thanks... that does now work when I include the ref= . It obviously makes sense to require the user to include the specific commit when using checkpoint, but perhaps the error could be a little more informative when it's not included? Or add a note to the docs?