Thanks, Yihui!

Luckily I kept R-2.15.0 and left it untouched (so I can continue to use that for now).  If it helps any, I was able to go back into Lyx and change the path to point to R-2.15.0 and I also changed the windows path environment variable to point to the old version.  After doing this, LyX worked fine with no problem on the code below.  Changing the paths back to the new version  R-2.15.2, generates the error below.

If anyone else has any idea how to resolve this, either through R or a Lyx/LaTeX fix, I'd be all ears.

Thanks, again for your response, Yihui!

Sincerely yours,

Mark J. Lamias




________________________________
 From: Yihui Xie <xie@yihui.name>

Cc: "r-help@r-project.org" <r-help@r-project.org> 
Sent: Thursday, November 29, 2012 2:02 PM
Subject: Re: [R] knitr error with Lyx

Quite a few people have had this problem, but since I'm unable to
reproduce it, I'm not exactly sure how to fix it either. A few
references that might be helpful to you:

http://stackoverflow.com/q/12448507/559676
https://github.com/yihui/knitr/issues/413

It is very likely to be a pure LaTeX problem. Letting MikTeX install
the missing LaTeX packages on the fly might solve the problem.

Regards,
Yihui
--
Yihui Xie <xieyihui@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



> R Users,
>
>
> I just upgraded my version of R from R-2.15.0 to R-2.15.2 and installed the latest versions of LyX and MikTex running Windows 7 Ultimate, 64-bit OS.  Prior to the upgrade, I was using Lyx with knitr to generate a document with no problems.  However, after the upgrade, and using the same LyX document, I'm receiving the following error when I attempt to compile the document:
>
> \end{verbatim}
> The control sequence at the end of the top line
> of your error message was never \def'ed. If you have
> misspelled it (e.g., `\hobx'), type `I' and the correct
> spelling (e.g., `I\hbox'). Otherwise just continue,
> and I'll forget about whatever was undefined.
>
> I have determined that the error is caused when printing the anova results from the anova statement in my R source code, but can't seem to resolve the issue.  Here is an example code chunk that creates the error:
>
> <<NonCP1, fig.width=6, fig.height=4, out.width='.8\\linewidth' ,par=FALSE>>=
> #Read in data
> y=c( 67, 73, 83, 89, 65, 91, 87, 86, 155, 127, 147, 212, 108, 100, 90, 153, 140, 142, 121, 150, 33, 8, 46, 54 )
> temp=as.factor(c(rep(seq(360, 380, 10), each=4), rep(seq(380, 360, -10), each=4)))
> coat=as.factor(rep(seq(1, 4), 6))
> replicate=as.factor(rep(seq(1, 6), each=4))
> #Obtain Factorial/Incorrect Model
> o=lm(y~temp*coat)
> ano=anova(o)
> ano
> @
>
>
> Removing the ano=anova(o) or ano lines in the code chunk allows the document to compile with no problem.  Does anyone else have this problem or did I do something wrong when I migrated to the newer versions?
>
[[elided Yahoo spam]]
>
> Sincerely yours,
>
> Mark J. Lamias
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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.
>
	[[alternative HTML version deleted]]


