1) Have you placed your code in an ERT (Tex code)?
2) Did you enclose it with the required tags for noweb (INSIDE de ERT),
i.e.,
<<>>=
library (car)
cabbages$Year<-recode(cabbages$Year,'"X2001"="2001";"X2002"="2002";"X2003"="2003";
etc
@
3) Did you run Sweave on the Noweb version produced?
Best,
Philippe Grosjean
Graham Smith wrote:
I've started using Sweave and having a problem
The code in Lyx is
library (car)
cabbages$Year<-recode(cabbages$Year,'"X2001"="2001";"X2002"="2002";"X2003"="2003";
etc
But its appearing in the PDF as
> cabbages$Year <- recode(cabbages$Year,
"\"X2001\"=\"2001\";\"X2002\"=\"2002\";\"X2003\"=\"2003\";\ etc
And obviously isn't working as printing out incorrectly.
Can anyone suggest what is happening here.
Many thanks,
Graham