[R] Problem with Sweave
Thomas Adams
Thomas.Adams at noaa.gov
Wed May 16 03:22:38 CEST 2007
I am using R 2.5 on a Linux Redhat platform. I can successfully run some
example *.Rnw files through Sweave and generate pdf files. When I try my
own example file, "test.Rnw":
\documentclass[a4paper]{article}
\title{Test Sweave Example}
\author{Thomas Adams}
\begin{document}
\maketitle
In this example we embed parts of the examples from the
\texttt{boxplot} and \texttt{lattice} figures into a \LaTeX{} document
<<>>=
library(verification)
library(lattice)
dat<-read.table("verification_summary_20051024_table.txt",sep="\t",header=TRUE)
\begin{center}
<<fig=TRUE,echo=FALSE>>=
boxplot(dat$MAE ~ dat$BASINID)
abline(h=1)
abline(h=0.5,col="red")
@
\end{center}
\end{document}
I get the following error:
xt4-tir:adams> echo 'Sweave("test.Rnw")' | R --vanilla --quiet
> Sweave("test.Rnw")
Writing to file test.tex
Processing code chunks ...
1 : echo term verbatim
Error: chunk 1
Error in parse(file, n, text, prompt, srcfile, encoding) :
syntax error, unexpected $undefined in:
"
"
Execution halted
I really do not know where to begin to decipher the error messages. Any
suggestions?
Regards,
Tom
--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
EMAIL: thomas.adams at noaa.gov
VOICE: 937-383-0528
FAX: 937-383-0033
More information about the R-help
mailing list