Hi, You should not use the document class "article (Noweb)". Since LyX 2.0, you can use the Sweave *module* with any document classes, e.g. article.
It seems you are using Windows, so you can take a look at the example sweave.lyx under the examples directory (somewhere like C:\Program Files\LyX20\Resources\examples). Sweave no longer depends on specific layouts. This is a significant change in LyX 2.0. Regards, Yihui -- Yihui Xie <xieyi...@gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Thu, May 12, 2011 at 8:21 PM, iftikhar ahmad <ifti_ch2...@yahoo.com> wrote: > Hi, > When I tried to include an R plot with the following code into > article(Noweb) in LyX 2.0.0 > > <<fig=TRUE>>= > library(graphics) > pairs(iris) > @ > > I got the following error message: > > {C:/Users/MYaseen208/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] > ! Missing $ inserted. > <inserted text> > $ > l.146 ...ir.Hp5960/lyx_tmpbuf2/sweave_example-007} > > I've inserted a begin-math/end-math symbol since I think > you left one out. Proceed, with fingers crossed. > ! LaTeX Error: File `C:/Users/MYaseen208/AppData/Local/Temp/lyx_tmpdir.Hp5 > 960/lyx_tmpbuf2/sweave_example-007' not found. > > Any idea to fix this problem. Thanks