我正在尝试创建一个 R-markdown 文档,我将在其中运行 multidplyr。为了确保可重复性,我决定使用检查点库。
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()
```
运行此代码会给我以下错误:
FUN(X[[i]], ...) 中的错误:没有名为“multidplyr”的包调用:... withVisible -> eval -> eval -> checkpoint -> lapply -> FUN
我尝试在没有 if 子句的情况下运行它 multidplyr 只是每次都安装它,然后我尝试使用 devtools 安装它,但我得到了同样的错误。有任何想法吗?