我在新的Win7 x64上设置了一个新的R和RStudio。当我想安装和加载包(来自RStudio内)时,似乎弹出似乎与packages namespace imports指令有关的错误。例如,在尝试加载ggplot2时的比例(中间有一些丹麦语):
> install.packages('ggplot2')
Installing package into ‘C:/Users/me/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/ggplot2_1.0.1.zip'
Content type 'application/zip' length 2675576 bytes (2.6 MB)
opened URL
downloaded 2.6 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\me\AppData\Local\Temp\RtmpodrNFq\downloaded_packages
> library(ggplot2)
Error in get(Info[i, 1], envir = env) :
cannot open file 'C:/Users/me/Documents/R/win-library/3.1/scales/R/scales.rdb': No such file or directory
Error: indlæsning af pakke eller navnerum fejlede for ‘ggplot2’
我是否需要对软件包秤(以及所有其他缺少的软件包)执行'install.packages()',或者有一种方法可以在您进行全新的R安装时更加自动化。
答案 0 :(得分:0)
如果查看DESCRIPTION文件,您会看到:
Depends: R (>= 2.14), stats, methods
Imports: plyr (>= 1.7.1), digest, grid, gtable (>= 0.1.1), reshape2,
scales (>= 0.2.3), proto, MASS
所以你可能会看到没有安装scales
包的副作用。您可以使用文件浏览器查看DESCRIPTION文件,也可以执行:
help(pac=ggplot2) # and click on the DESCRIPTION file link at the top of that page.