Packrat:快照与恢复的顺序是否重要?

时间:2017-11-14 08:41:42

标签: r packrat

有时使用 packrat 时,会在检查packrat库的状态时获得此类输出:

switch(samplestring){
case samplestring.match(regex1): console.log("regex1");
case samplestring.match(regex2): console.log("regex2");
case samplestring.match(regex3): console.log("regex3");
}

我的问题是:首先应运行哪一个,> packrat::status() The following packages are tracked by packrat, but are no longer available in the local library nor present in your code: _ viridisLite 0.2.0 You can call packrat::snapshot() to remove these packages from the lockfile, or if you intend to use these packages, use packrat::restore() to restore them to your private library. The following packages have been updated in your library, but have not been recorded in packrat: library packrat RSQLite 2.0 NA blob 1.1.0 NA formatR 1.5 NA Use packrat::snapshot() to record these packages in packrat. The following packages are out of sync between packrat and your current library: packrat library BH 1.65.0-1 1.60.0-2 R6 2.2.2 2.2.0 Rcpp 0.12.13 0.12.7 Rfacebook 0.6.17 0.6.15 assertthat 0.2.0 0.1 backports 1.1.1 1.0.5 colorspace 1.3-2 1.2-6 curl 3.0 2.1 dplyr 0.7.4 0.5.0 htmltools 0.3.6 0.3.5 httr 1.3.1 1.2.1 jsonlite 1.5 1.4 lazyeval 0.2.1 0.2.0 openssl 0.9.8 0.9.4 reshape2 1.4.2 1.4.1 scales 0.5.0 0.4.1 stringi 1.1.5 1.1.2 tibble 1.3.4 1.2 yaml 2.1.14 2.1.13 Use packrat::snapshot() to set packrat to use the current library, or use packrat::restore() to reset the library to the last snapshot. restore()?我查看了packrat文档,但似乎没有办法可以执行参数化更新,即在包装上进行挑选。

更新
根据Alex的建议,我收到了这个提示:

snapshot()

答案是

我想要做的是删除> packrat::restore() Adding these packages to your library: _ viridisLite 0.2.0 Removing these packages from your library: _ RSQLite 2.0 blob 1.1.0 formatR 1.5 memoise 1.1.0 Upgrading these packages in your library: from to BH 1.60.0-2 1.65.0-1 R6 2.2.0 2.2.2 Rcpp 0.12.7 0.12.13 Rfacebook 0.6.15 0.6.17 assertthat 0.1 0.2.0 backports 1.0.5 1.1.1 colorspace 1.2-6 1.3-2 curl 2.1 3.0 dplyr 0.5.0 0.7.4 glue 1.1.1 1.2.0 htmltools 0.3.5 0.3.6 httr 1.2.1 1.3.1 jsonlite 1.4 1.5 lazyeval 0.2.0 0.2.1 openssl 0.9.4 0.9.8 reshape2 1.4.1 1.4.2 rlang 0.1.1 0.1.4 scales 0.4.1 0.5.0 stringi 1.1.2 1.1.5 tibble 1.2 1.3.4 yaml 2.1.13 2.1.14 Do you want to continue? [Y/n]: ,而不是添加它,我想按照建议添加viridisliteRSQLiteblob

现在我也想知道formatR是如何进入画面的......

1 个答案:

答案 0 :(得分:0)

这取决于您对packrat的要求。如果要加载上一个快照,请使用restore()。如果您更新项目中使用的软件包,并想创建新快照,请使用snapshot()