0

I installed sp and automap libraries to my R 3.0.1 64-bit under Windows 7 (via install.packages command). Installation of them did not display any error and library(sp) works fine however when I try to execute library(automap) I get the following error:

> 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'

I looked from the path and indeed there is no DESCRIPTION file (or folder) in that path. However there is just libs folder under which folder x64 and inside it file sp.dll

Any idea what could cause this?

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149

1 Answers1

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).

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
  • Addon: I installed both packages as administrator originally. Thus installing as admin is not solution. – user2646205 Aug 02 '13 at 14:31
  • And loading the packages as admin? – Paul Hiemstra Aug 02 '13 at 14:36
  • That solved the issue. Hmm, I have never encounted such a problem with R package. But indeed it requires loading the package as admin (installing as admin & running as normal user was not enough). – user2646205 Aug 02 '13 at 14:45
  • I added some details to explain what I think goes wrong. In addition, if this answers your question, please push the green tick mark to mark it as answered. – Paul Hiemstra Aug 02 '13 at 14:51