[R] Problem opening connections to removable hard drive

Elizabeth Purdom epurdom at stat.Berkeley.EDU
Tue Apr 24 21:48:57 CEST 2007


I have my files and R session on a portable hard drive to be able to 
work across computers since I have some extremely large files. I have 
just started doing this and generally it works as I expect. But after a 
while of using my R session, certain types of calls to open connections 
on the hard drive don't work. But I experience no problems 
opening/saving files on the portable hard drive using other programs.

In particular, if I explicitly call the entire folder path to the hard 
drive, I can save an object to file, for example. But if I just want to 
save it in the current working directory, without explicitly naming the 
entire path, then I have problems (I show an example below). I am using 
a package that assumes a certain file structure from the current working 
directory in order to find/write output, which is why I want to be able 
to rely on not explicitly calling the whole path. Furthermore, I was 
experimenting just now, and when I changed the current directory to 
another one, and then back to the removable hard drive, everything gets 
'reset' somehow and opening connections works again, just like when I 
first started up my session.

I am on Windows XP, R 2.4.0.

Elizabeth Purdom

 > getwd()
[1] "I:/ICBP/Exon Array/Data"
#explicit call to hard drive works...
 > save(x,file="I:/ICBP/Exon Array/Data/tmp.rdata")
#unexplicit call relying on knowing working directory doesn't...
 > save(x,file="tmp.rdata")
Error in gzfile(file, "wb") : unable to open connection
In addition: Warning message:
cannot open compressed file 'tmp.rdata'

More information about the R-help mailing list