Evening all:
I'm taking a little time to experiment with R, Sweave, and Miktex/LaTex but
I've run up against some problems and -well- I hope that there are some on
the list who might have some suggestions. This will be kind of wordy as I
will include the complete files involved as I'm just not sure what I'm
looking for. Apologies at the outset.
I created the source file (example.Snw):
\documentclass[12pt,letterpaper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch}
\begin{document}
\maketitle
In this example we embed parts of the examples from the
\texttt{kruskal.test} help page into a \LaTeX{} document:
=
data(airquality)
library(stats)
kruskal.test(Ozone ~ Month , data=airquality)
@
which shows that the location parameter of the Ozone distribution varies
significantly from month to month. Finally we include a boxplot of the data:
\begin{center}
fig=TRUE , echo=FALSE=
boxplot(Ozone ~ Month , data=airquality)
@
\end{center}
\end{document}
which R seems to accept gracefully to produce the tex file (example.tex):
\documentclass[12pt,letterpaper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch}
\usepackage{C:/PROGRA~1/R/R-23~1.1/share/texmf/Sweave}
\begin{document}
\maketitle
In this example we embed parts of the examples from the
\texttt{kruskal.test} help page into a \LaTeX{} document:
\begin{Schunk}
\begin{Sinput}
data(airquality)
library(stats)
kruskal.test(Ozone ~ Month, data = airquality)
\end{Sinput}
\begin{Soutput}
Kruskal-Wallis rank sum test
data: Ozone by Month
Kruskal-Wallis chi-squared = 29.2666, df = 4, p-value = 6.901e-06
\end{Soutput}
\end{Schunk}
which shows that the location parameter of the Ozone distribution varies
significantly from month to month. Finally we include a boxplot of the data:
\begin{center}
\includegraphics{example-002}
\end{center}
\end{document}
but when I try to run Latex on it I get errors (example.log):
This is e-TeX, Version 3.141592-2.2 (MiKTeX 2.4) (preloaded format=latex
2006.8.3) 3 AUG 2006 20:57
entering extended mode
**example.tex
(example.tex
LaTeX2e 2005/12/01
Babel v3.8g and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, french, ukenglish, loaded.
(C:\texmf\tex\latex\base\article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(C:\texmf\tex\latex\base\size12.clo
File: size12.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
{document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H return for immediate help.
...
l.5 \begin
{document}
You're in trouble here. Try typing return to proceed.
If that doesn't work, type X return to quit.
! Extra \endcsname.
[EMAIL PROTECTED] [EMAIL PROTECTED] -h@@k\endcsname
[EMAIL PROTECTED] \let
\CurrentOptio...
l.5 \begin
{document}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
{document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.
! Extra \endcsname.
[EMAIL PROTECTED]@aded ...er \ifx \csname [EMAIL PROTECTED]
\relax \expandafter
[EMAIL PROTECTED]
l.5 \begin
{document}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
{document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.
! Extra \endcsname.
[EMAIL PROTECTED]@ptions ...xdef \csname [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
l.5 \begin
{document}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
{document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
{document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.
! Extra \endcsname.
argument ...e/texmf/[EMAIL PROTECTED] \endcsname
,
l.5 \begin
{document}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
to be read again