[R] double-click in RData file versus load( file )

Duncan Murdoch murdoch at stats.uwo.ca
Sun Jan 27 15:17:10 CET 2008

On 26/01/2008 9:03 PM, Cleber Nogueira Borges wrote:
> hi Gabor and Duncan,
> I make a test and I find that the key of problem
> is the setwd() command in my Rprofile.site
> I don't understand this behaviour yet! :-(

I understand it now.  It's a small bug in the startup code.

When you specify a file to restore on the command line, it has two 
effects:  it changes the working directory to the directory of that 
file, and it loads the file.  Unfortunately, the code that loaded the 
file assumed it was in the current directory and used a relative 
filename, not an absolute path.  (I think this was due to workarounds 
for behaviour of old Windows versions that are no longer supported.)

When your Rprofile.site file changed the working directory, R tried to 
load the test.RData file from there, and failed.  So you didn't get what 
you wanted.

I'll fix this in R-devel and R-patched, and it should make it into the 
next release.

Duncan Murdoch

More information about the R-help mailing list