From zivan.karaman at gmail.com  Fri Aug 10 18:09:17 2007
From: zivan.karaman at gmail.com (zivan.karaman at gmail.com)
Date: Fri, 10 Aug 2007 18:09:17 +0200 (CEST)
Subject: [Rd] available.packages (PR#9841)
Message-ID: <20070810160917.4FB8666804@slim.kubism.ku.dk>

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.



[Rd] available.packages (PR#9841)
zivan.karaman at gmail.com