[R] Problems installing packages using the inbuilt facility: "Error i n gzfile(file, "r") : unable to open connection"

From: Kauer, Philipp <philipp.kauer_at_credit-suisse.com>
Date: Fri, 07 Mar 2008 13:02:51 -0500


I have been trawling the web, FAQs, and R manuals for help on the following issue, but have failed and was wondering if anyone has a solution to the following problem:

After having installed R 2.6.2 for Windows (binary), I tried to install various packages. Every time I try loading a package (any package) via the built-in menu, I run into the following error message.

> utils:::menuInstallPkgs()

trying URL '
http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip <http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip> ' Content type 'application/zip' length 971893 bytes (949 Kb) opened URL
downloaded 949 Kb

Warning in gzfile(file, "r") :
  cannot open compressed file 'ada/DESCRIPTION', probable reason 'No such file or directory' Error in gzfile(file, "r") : unable to open connection
> traceback()

6: gzfile(file, "r")
5: read.dcf(file.path(curPkg, "DESCRIPTION"), c("Package", "Version",

4: unpackPkg(foundpkgs[okp, 2], foundpkgs[okp, 1], lib, installWithVers) 3: .install.winbinary(pkgs = pkgs, lib = lib, contriburl = contriburl,

       method = method, available = available, destdir = destdir, 
       installWithVers = installWithVers, dependencies = dependencies)
2: install.packages(NULL, .libPaths()[1], dependencies = NA, type = type)
1: utils:::menuInstallPkgs()

I tried saving the ZIP of the package to my C drive, and then installing from that, but I get the same error message. I then tried calling gzfile with the filename of the ZIP directly, and I seem to get a file handle without any error message:

gzfile("C:/Program Files/R/R-2.6.2/library/ada_2.0-1.zip","r")

                                       description                                              class 
"C:/Program Files/R/R-2.6.2/library/ada_2.0-1.zip"                                           "gzfile" 
                                              mode                                               text 
                                             "rb6"                                           "binary" 
                                            opened                                           can read 
                                          "opened"                                              "yes" 
                                         can write 

It might be worth noting, that I initially I also had problems with the internet download facility, which I fixed starting R with the flag --internet2, as indicated in the FAQs.

Can you please help?

Many thanks - Philipp

PS: I did the same on my PC at home, and there everything works without problems.

Please access the attached hyperlink for an important el...{{dropped:8}}

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 07 Mar 2008 - 18:06:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 08 Mar 2008 - 01:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive