[R] Sweave problem

Murray Jorgensen maj at stats.waikato.ac.nz
Thu Feb 5 03:08:23 CET 2004


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]
-- 
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    +64 7 849 6486 home    Mobile 021 1395 862




More information about the R-help mailing list