Skip to content
Prev 167584 / 398502 Next

Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

Matthieu Stigler wrote:
You could use a fully qualified prefix, so it doesn't matter what the 
current directory is when you save a plot.

Or you could avoid setwd().

Or you could change back to the original directory before drawing a plot.

It would probably make sense for Sweave to do the last of these 
internally:  it is mixing up characteristics of the session it's running 
in with characteristics of the session it is running.  However, this is 
a pretty strange case, and I'm not sure fixing it will be a high priority.

Duncan Murdoch