I'm trying to create an R-markdown document in which I will be running multidplyr. In order to ensure reproducability I decided to use the checkpoint library.
MWE:
---
title: "A great title"
author: "A great author"
date: "February 19, 2019"
output: html_document
---
```{r setup, include=F}
#Set knitr options
knitr::opts_chunk$set(echo = TRUE,
collapse = TRUE,
cache = TRUE,
#do not miss changing this folder to run the MWE
root.dir = "<my_folder>"
)
#Load packages
if(!("pacman" %in% .packages(all.available = T))){
install.packages("pacman")
library("pacman")
}else if(!("pacman" %in% (.packages()))){
library("pacman")
}
p_load(magrittr, readr, plyr, dplyr, tidyr, stringr, ggplot2, purrr, parallel,
ggplot2, corrplot, ggfortify, cluster, ggbiplot, ggrepel, checkpoint)
if(!p_isinstalled("multidplyr")){
p_install_gh("hadley/multidplyr")
library(multidplyr)
}else if(!p_loaded(multidplyr)){
library(multidplyr)
}
#Make folder for checkpoint
if(!dir.exists('.checkpoint')) dir.create('.checkpoint')
#Set checkpoint
checkpoint("2019-02-19", R.version = '3.5.1', checkpointLocation = getwd())
```
#Session Info
```{r session, echo=TRUE}
sessionInfo()
```
Running this code gives me the following error:
Error in FUN(X[[i]], ...) : there is no package called 'multidplyr' Calls: ... withVisible -> eval -> eval -> checkpoint -> lapply -> FUN
I tried running it without the if clause for multidplyr simply installing it every time, further I tried installing it with devtools, but I get the same error. Any ideas?