0

我在 Windows 7 下将 sp 和 automap 库安装到我的 R 3.0.1 64 位(通过 install.packages 命令)。它们的安装没有显示任何错误,并且 library(sp) 工作正常但是当我尝试执行 library(automap) 时,我收到以下错误:

> library(automap)
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning messages:
1: In read.dcf(file.path(p, "DESCRIPTION"), c("Package", "Version")) :
   cannot open compressed file 'C:/Program Files/R/R-3.0.1/library/sp/DESCRIPTION', probable reason 'No such file or directory'
2: In gzfile(file, "rb") :
  cannot open compressed file '', probable reason 'Invalid argument'

我从路径中查看,该路径中确实没有DESCRIPTION文件(或文件夹)。但是只有 libs 文件夹在 x64 文件夹下,其中包含文件 sp.dll

知道是什么原因造成的吗?

4

1 回答 1

2

I would definitely try to run R as administrator, both for installing the packages and loading them. This could solve your problem.

This probably has to do with file permissions. When you install the packages as admin in a location where only admin can read/write, running R as a normal user means you do not have the file permissions needed to load the package. Running R as admin will solve this, as admin does have the correct permissions.

Alternatively, you could install your R packages in a location where a normal user has read/write persmissions, e.g. C:/Users/UserName (or something like that, I do not have my windows machine accesible right now).

于 2013-08-02T14:07:10.810 回答