在尝试安装某些(或全部?)R 包时,我总是遇到以下类型的错误,在我看来,这不是特定于特定包,而是特定于我的R 环境。
> install.packages("plspm")
Installing package into ‘/home/ruser/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘shape’, ‘amap’, ‘diagram’, ‘tester’, ‘turner’
trying URL 'http://cran.rstudio.com/src/contrib/shape_1.4.1.tar.gz'
Content type 'application/x-gzip' length 683458 bytes (667 Kb)
opened URL
==================================================
downloaded 667 Kb
trying URL 'http://cran.rstudio.com/src/contrib/amap_0.8-12.tar.gz'
Content type 'application/x-gzip' length 257611 bytes (251 Kb)
opened URL
==================================================
downloaded 251 Kb
trying URL 'http://cran.rstudio.com/src/contrib/diagram_1.6.2.tar.gz'
Content type 'application/x-gzip' length 466608 bytes (455 Kb)
opened URL
==================================================
downloaded 455 Kb
trying URL 'http://cran.rstudio.com/src/contrib/tester_0.1.7.tar.gz'
Content type 'application/x-gzip' length 112000 bytes (109 Kb)
opened URL
==================================================
downloaded 109 Kb
trying URL 'http://cran.rstudio.com/src/contrib/turner_0.1.7.tar.gz'
Content type 'application/x-gzip' length 106530 bytes (104 Kb)
opened URL
==================================================
downloaded 104 Kb
trying URL 'http://cran.rstudio.com/src/contrib/plspm_0.4.1.tar.gz'
Content type 'application/x-gzip' length 367040 bytes (358 Kb)
opened URL
==================================================
downloaded 358 Kb
The downloaded source packages are in
‘/tmp/RtmpJsgPbd/downloaded_packages’
> library(plspm)
Error in library(plspm) : there is no package called ‘plspm’
这是我的 R 环境信息:
> sessionInfo()
R version 3.0.3 (2014-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C
[4] LC_COLLATE=C LC_MONETARY=C LC_MESSAGES=C
[7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.1 bitops_1.0-6
loaded via a namespace (and not attached):
[1] tools_3.0.3
在 RStudio 中,我还尝试指定dependencies=TRUE
ininstall.packages()
并指定type="source"
(无论如何这在 Linux 上都是默认设置),但无济于事。
似乎我总是能够通过从命令行(作为ruser
用户)手动成功安装 R 包来克服这个问题,这次也是如此:
R CMD INSTALL --build <'plspm' dependencies and their dependencies>
R CMD INSTALL --build plspm_0.4.1.tar.gz
> library(plspm)
Loading required package: amap
Loading required package: diagram
Loading required package: shape
Loading required package: tester
Loading required package: turner
> installed.packages()
Package LibPath
plspm "plspm" "/home/ruser/R/x86_64-pc-linux-gnu-library/3.0"
Version Priority
plspm "0.4.1" NA
Depends
plspm "R (>= 3.0.1), amap, diagram, tester, turner"
NeedsCompilation Built
plspm "no" "3.0.3"
问题
为什么我能够plspm
通过手动安装其依赖项,然后在从 Ubuntu as 命令行启动的 R 会话中逐步安装其依赖项,然后成功安装(和其他软件包)ruser
,但未能做到这一点从 RStudio 服务器中?
对于在我的 R 环境中理解和解决这个系统性问题的任何建议,我将不胜感激!