This is a problem with sweave as well, but when you change a directory
setwd("aplace")
this will output the figures and the .tex in ~ directory. It can even lead to having stuff really scattered.
setwd("here") plot(something) setwd("there") plot(something) ...
It can even bring LyX to crash.