[Bioc-devel] Zipped Rdata files in windows binaries

Tarca, Adi atarca at med.wayne.edu
Fri Feb 6 20:05:09 CET 2009

Hi all,
I am writing an R packge and at a given point I need to load an Rdata file from the "data" folder of the installed package, and in case the file it is not there I try to download it from somwhere.

I used to do the following test to see if a file called "datload" is NOT there, case in which I need to download it:

 if(! paste(datload,".RData",sep="") %in% dir(system.file("data",package="SPIA"))) {
 ...download the file from somwhere else

It works fine except that the windows binary package created by bioconductor scripts from my source, puts all RData file in a Rdata.zip file. Is there a way to list the files in Rdata.zip to see if my file is in there? 

Alternatively I tried to use the data() function and try to load it (in a private environment), and in case it is not loaded  then try to download it. However, the data() function does not return an error but only a warning.
I tried to use:

ow <- options("warn") 
options(warn=2) # to make warnings into errors 
errs<-try(data(list=datload, envir=.myDataEnv),silent=TRUE)

  ...download the file from somwhere else
This works fine, except that a warning is still printed when the function returns.

Any ideas would be appreciated.

Adi Laurentiu Tarca

More information about the Bioc-devel mailing list