I am introducing the scan() function to my class. Consider the following file (Scanexamp.Rnw )

\documentclass[12pt]{article}

\begin{document}
<<>>=
height = scan()
64 62 66 65 62
69 72 72 70

part = scan(what = character(0))
 "Soprano" "Soprano" "Soprano"
 "Alto"    "Alto"    "Tenor"
 "Tenor"   "Bass"    "Bass"

sh = data.frame(height, part)
sh
@
\end{document}

Now what happens when I attempt to Sweave this is

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

Error:  chunk 1
Error in parse(text = chunk) : unexpected numeric constant in:
"height = scan()
64 62"
>

Comments would be appreciated. (And thanks to Ross Darnell for a lot of help on another list.)

Cheers,  Murray Jorgensen

--
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: m...@waikato.ac.nz                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    Home +64 7 825 0441   Mobile 021 0200 8350

______________________________________________
R-help@r-project.org 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.

Reply via email to