[R] Sweave error in example code

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Mon Jul 31 19:52:57 CEST 2006

LL wrote:
> Hi.. I am running R version 2.3.1 on a Windows XP machine with the latest Miktex 2.5 installed. I get no errors from R when running the Sweave example, 
> testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils")
> However, when I tex the resulting .tex file (after installing a4.sty) I get the error below. 
> This is pdfeTeX, Version 3.141592-1.30.6-2.2 (MiKTeX 2.5 RC 1)
> entering extended mode
> (Sweave-test-1.tex
> LaTeX2e <2005/12/01>
> Babel <v3.8g> and hyphenation patterns for english, dumylang, nohyphenation, ge
> rman, ngerman, french, loaded.
> ("C:\Program Files\MiKTeX 2.5\tex\latex\base\article.cls"
> Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
> ("C:\Program Files\MiKTeX 2.5\tex\latex\base\size10.clo"))
> ("C:\Program Files\MiKTeX 2.5\tex\latex\ltxmisc\a4wide.sty"
> ("C:\Program Files\MiKTeX 2.5\tex\latex\ntgclass\a4.sty"))
> ! Missing \endcsname inserted.
> <to be read again> 
>                    \protect 
> l.11 \begin
>            {document}
> ? 
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at stat.math.ethz.ch 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.

This works for me. However, when I ran this, MiKTeX prompted me to 
install the ntgclass package, which I did. Everything ran smoothly after 
that. I'm using R-2.3.1 with MiKTeX 2.4 in WinXP Pro.



More information about the R-help mailing list