[R] Problem compiling Rnw file

Riccardo Romoli ric.romoli at gmail.com
Mon Nov 5 16:23:49 CET 2012


Dear R list,
I'm using R 2.15.2 with TeX Live 2009 and ESS 12.09 . I have a R
project in the '/home/r/Documents/myproj/', which is my working
directory (where I have the .Rnw file). Inside the document I have
several "setwd()" to collect the datasets I use.

After I compile from the terminal using "R CMD Sweave myproj.Rnw", I
receive the error:

Error in driver$finish(drobj) :
  the output file 'myproj.tex' has disappeared
Calls: <Anonymous> -> do.call -> <Anonymous> -> <Anonymous>
Execution halted

but the file "myproj.tex" is produced and if I compile it using
"pdflatex myproj.tex" all works fine.

Googling I found a similar problem but that guy have problem also
compiling the tex file. I found enteresting a comment: "Thou shall
never setwd() inside a report! setwd() should always be kept out of a
report [...]". This is what I found:
http://stackoverflow.com/questions/12162092/r-sweave-output-error

Anyone knows why that happens?? Have you any idea about this kind of
error?? How can I solve this problem without moving the files and the
folders where I have the data sets??

Best
Riccardo



More information about the R-help mailing list