Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am attempting to use Sweave with R2.11.1 and Texmaker on Ubuntu 10.10. I have done this previously on Windows XP, where one saves the tex file as .Rnw and then processes it with Sweave. I have all the files in R's current working directory, but it does not appear to work.

Whenever I run the Sweave command, a blank tex file is created, and then R stops, giving me the following error:

 Error in SweaveReadFile(file, syntax) : 
     no Sweave file with name 'example.Snw' found

I even tried loading the example sweave file from the R tools library, and even that does not work. Can anyone advise if they know of a solution for this problem, or please let me know if you need further information.

share|improve this question
    
I think we may need more information to figure this out. How exactly do you run the Sweave command? Are you running it from the shell, or from Texmaker? What exact command line do you use? Is there something in your Rnw file that would try to include a file called "example.Snw'? Could you create a minimal example of a Rnw file that causes this, and post it here? What do you mean by "all the files"? –  Jan Hlavacek Dec 22 '10 at 15:25
    
I opened up R in a terminal and set it to the directory which contains the Sweave file. The command Sweave(file.Rnw) produces the error noted above. I also tried .Snw and .rnw to assess if it was the extension which was the problem. The example file I was running can be found here: stat.uni-muenchen.de/~leisch/Sweave/example-1.Snw . I also tried running Sweave from the command line outside R, and got the same error. I have now tracked down the source of the error - the Sweave command does not like names with spaces, even enclosed in quotes. Apologies for any time wasted. –  Richie Morrisroe Dec 22 '10 at 17:06
add comment

1 Answer

up vote 1 down vote accepted

Richie wrote in a comment above:

I have now tracked down the source of the error - the Sweave command does not like names with spaces, even enclosed in quotes.

share|improve this answer
    
Answering so we can get this off the "Unanswered" list. –  Charles Stewart Apr 19 '11 at 14:35
    
sorry for not accepting an answer for this –  Richie Morrisroe Apr 20 '11 at 11:54
    
@Richie: It's only been there for less than a day! –  Charles Stewart Apr 20 '11 at 12:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.