当尝试安装某些(或所有?)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
中指定install.packages()
并指定type="source"
(无论如何都是Linux上的默认值),但无济于事。
似乎我总是能够通过从命令行手动成功安装R包来解决这个问题(如ruser
用户),这次也是如此:
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中从命令行启动的R会话中逐步安装它们。 ruser
,但未能在RStudio Server中做同样的事情?
我很感激在R环境中理解和解决这个系统性问题的任何建议!