When running pgfSweave using a file with the following sample code:
\documentclass[letter]{article}
\begin{document}
In this example we embed parts of the examples from the
\texttt{kruskal.test} help page into a \LaTeX{} document :
<<>>=
data(airquality)
kruskal.test(Ozone ~ Month, data = airquality)
@
\end{document}
and this command:
pgfSweave("sweave.Snw")
the following error occurs:
...(latex header)....
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty")))
! Missing \endcsname inserted.
<to be read again>
...(latex crashing out)...
This file works fine with this command:
Sweave("sweave.Snw")
and then "latex sweave.tex" at the command line.