Skip to content
Prev 43728 / 398513 Next

Sweave problem

Here is the file minimal.Snw:

\documentclass[a4paper]{article}
\title{R tips and tricks}
\author{Murray Jorgensen}
\usepackage{Sweave}
\begin{document}
\maketitle
\section*{Entering data from a single variable}
The following data are transformed tensile strength measurements on 
polyester
fibres. They may be found on the file \texttt{TENSILE.DAT}. We
may enter this data into R using the \texttt{scan} command.
<<>>=
strength <- scan()
0.023   0.032   0.054   0.069   0.081   0.094
0.105   0.127   0.148   0.169   0.188   0.216

@
\end{document}

and now I attempt to use SWeave to convert it to minimal.tex:

 > Sweave("minimal.Snw")
Writing to file minimal.tex
Processing code chunks ...
  1 : echo term verbatim

Error:  chunk 1
Error in parse(file, n, text, prompt) : parse error

It seems a rather simple piece of code to generate such an error message!

Murray

[R 1.8.1 on Windows XP]