如何选择特定版本的r包?

时间:2017-04-13 17:27:16

标签: r

我想运行包“multcomp”,它需要一个依赖包“生存”,

但我有两个版本的生存存储在两个不同的位置。

survival "/panfs/panasas01/socs/yy5245/R/x86_64-pc-linux-gnu-library/3.2"
survival "/cm/shared/languages/R-3.2.2-ATLAS/lib64/R/library"

survival "2.41-3" "recommended" "R (>= 2.13.0)"
survival "2.38-3" "recommended" "R (>= 2.13.0), graphics, stats"

multcomp似乎只能识别太旧的2.38-3版本。如何制作multcomp只选择2.41-3版本?

由于

所以,我试过了

.libPaths()

[1] "/panfs/panasas01/socs/yy5245/R/x86_64-pc-linux-gnu-library/3.2"
[2] "/cm/shared/languages/R-3.2.2-ATLAS/lib64/R/library"

search()
 [1] ".GlobalEnv"            "package:MASS"          "package:survival"
 [4] "package:BiocInstaller" "package:stats"         "package:graphics"
 [7] "package:grDevices"     "package:utils"         "package:datasets"
[10] "package:methods"       "Autoloads"             "package:base"
> detach(3,unload=TRUE)

在定义的路径中重新加载生存

library("survival",lib.loc="/panfs/panasas01/socs/yy5245/R/x86_64-pc-linux-gnu-library/3.2")

但是当我从github安装时,我仍然得到

install_github("perishky/meffil",lib=.libPaths()[1])
Downloading GitHub repo perishky/meffil@master
from URL https://api.github.com/repos/perishky/meffil/zipball/master
Installing meffil
'/cm/shared/languages/R-3.2.2-ATLAS/lib64/R/bin/R' --no-site-file  \
  --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/tmp/RtmpCRXJSM/devtools5252a46ada7/perishky-meffil-e385e64'  \
  --library='/panfs/panasas01/socs/yy5245/R/x86_64-pc-linux-gnu-library/3.2'  \
  --install-tests

 installing *source* package 'meffil' ...
** R
** inst
** tests
** preparing package for lazy loading
Warning: character(0)
Error : package 'survival' 2.38.3 was found, but >= 2.39.4 is required by 'multcomp'
ERROR: lazy loading failed for package 'meffil'
* removing '/panfs/panasas01/socs/yy5245/R/x86_64-pc-linux-gnu-library/3.2/meffil'
Error: Command failed (1)

我不明白的是,当我检查生存时,它是正确加载的版本......

packageVersion("survival")
[1] '2.41.3'

0 个答案:

没有答案