[Rd] available.packages (PR#9841)

From: <zivan.karaman_at_gmail.com>
Date: Fri, 10 Aug 2007 18:09:17 +0200 (CEST)


Full_Name: Zivan Karaman
Version: 2.5.1
OS: Windows XP SP2
Submission from: (NULL) (195.6.68.214)

I think that I have encountered a bug in the function "available.packages" when using a local repository (file://) on Windows.

Version information:

platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          2                           
minor          5.1                         
year           2007                        
month          06                          
day            27                          
svn rev        42083                       
language       R                           
version.string R version 2.5.1 (2007-06-27)

I have made a copy of the CRAN "/bin/windows/contrib/2.5" directory in the "D:/CRAN" folder on my machine.

When I issue the command:

available.packages(contrib.url("file://D:/CRAN"))

I get the follwoing message:
Error in gzfile(file, "r") : unable to open connection In addition: Warning message:
cannot open compressed file ':/CRAN/bin/windows/contrib/2.5/PACKAGES' in: gzfile(file, "r")

Looking at the source code, I've spotted the following lines which seem to cause trouble:

            if (.Platform$OS.type == "windows") {
                if (length(grep("[A-Za-z]:", tmpf))) 
                  tmpf <- substring(tmpf, 2)
            }

Deleting them, the function works OK.

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 10 Aug 2007 - 22:25:08 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 Wed 22 Aug 2007 - 02:39:35 GMT.

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