R Sweave output error

I'm using RStudio v0.96.331 with pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian). I have a R project in the '/home/operacao/Myprojs/projName', which is my working directory.

Now, if i create a folder called 'reports' in '/home/operacao/Myprojs/projName/reports', and inside the sweave file (which is in the reports folder) use the code

  setwd('/home/operacao/Myprojs/projName')

After loading some packages, i receive the error

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

But the file is in the folder, and the plots i made appear in the .pdf. The text output does not appear.

Anyone knows why that happens? If i save the Sweave files in my directly in my working directory, everything works fine.

Thanks!


Probably RStudio requires you to set the working directory to the location which contains the Sweave file. Why do you need to set your working directory to another directory? You could use source to load any R code files which are in projName .

链接地址: http://www.djcxy.com/p/63080.html

上一篇: Meteor.js:<script>标记在<body>内不起作用

下一篇: R Sweave输出错误