[R] Sweave problem in Windows

Christophe DECLERCQ c.declercq at orsnpdc.org
Thu Sep 27 12:12:28 CEST 2007


Hi, Huang 

> De : r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] De la part de huang min
> Envoyé : jeudi 27 septembre 2007 11:31
> 
> Hi,
> 
> I have searched the lists but still can not solve the 
> problem. I am using a windows machine. After I sweave some 
> Rnw file, I got a tex file. However, the tex file can not be 
> compiled. I know the problem is in the line 
> \usepackage{C:/PROGRA~1/R/R-25~1.1/share/texmf/Sweave} and I 
> need to modify this line to \usepackage{Sweave}.
> 
> I hope there can be some automatic way to do this instead of 
> changing this line in the tex file whenever I modify 
> something. Thank you.

This is a FAQ: see
http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html#x1-14000A.12
Which says:

"If you can create the .tex file by running Sweave() in R, but cannot convert the .tex file to .dvi or .pdf, this is most likely caused by a space in the path of your R installation. If the path of your R installation contains any blank characters (like the default "c:\Program Files\..." in English versions of Windows), this may cause problems, because programs like tex or latex cannot handle blanks in paths properly.
Two possible solutions:
   1. Install R in a path not containing any blanks.
   2. Copy the file Sweave.sty to a directory in your tex path or the directory containing the Sweave file and put a \usepackage{Sweave} into the preamble of your Sweave file."

I use the first solution...

Christophe
--
Christophe Declercq, MD
Observatoire régional de la santé Nord-Pas-de-Calais
235, avenue de la recherche BP 86
F-59373 LOOS Cédex
Phone 33 3 20 15 49 24
Fax 33 3 20 15 10 46
E-mail c.declercq at orsnpdc.org
 

> 
> Huang
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 


More information about the R-help mailing list