问题
I had a problem using function Sweave. It seemed to be an encoding problem because I did not specify any encoding like: \usepackage[latin1]{inputenc}.
Now using button "Compile PDF" works -> PDF is generated and everythink is OK. But I'm getting 30 warnings and 18 badboxes.
Using function Sweave to generate first the tex file fails with this message:
Error: chunk 4 (label = t4)
Error in file(con, "w") : cannot open the connection
In addition: There were 31 warnings (use warnings() to see them)
So one warning more than before.
Do you have any idea?
回答1:
The problem was created by using .. for the paths setted by the R code. Using complete path with "C:\Users\test\" instead of "..\test\" solved the problem. So the code from folder "test" couldnt be loaded because the Sweave-Function used other paths (like WORKING DIRECTORY).
来源:https://stackoverflow.com/questions/35603194/error-compiling-rnw-to-tex