Hi I've prepared updated Sweave examples, will put into your Wiki after I can get one of two of you to tell me I'm not grossly wrong.
http://pj.freefaculty.org/guides/Computing-HOWTO/LatexAndLyx/LyX-sweave-tutorial/ In the directory on LyX articles, I have mostly a salute to your fabulous improvements (see article-1) and then some customizations I prefer in (article-2). I think a couple of R usage changes and a change over to "Sweavel.sty" helps quite a bit in the final presentation. This breaks R/S export, unfortunately (see below). The key element there is that the user does need to get the Sweavel.sty file and install it somewhere. The current working directory should suffice, but in Windoze we get the warning that LyX can't find the file. (I asked about that here a few months ago). Sweaving with slides is still a bad challenge for most people, I did my best to explain in the beamers directory. I hit some complications with Beamer slides and LyX 2.1, so I put that problem aside a couple of months ago. What I have is a demonstration for 2.0.8. The slides problem is complicated enough that I'm recommending that people should just learn to type the ERT to create slides with [containsverbatim, allowframebreaks]. The LyX GUI makes this a bit difficult otherwise. Also, I want to avoid some of the LyX 2.1 complications with scope and nesting that have been discussed here. I came away with a lot of admiration for the engineering effort you made to make articles Sweave easily. It is so much easier now than it was in 2001 I can't hardly believe it. The one problem I don't understand is in article-2 and exporting to R/S. If you try that export, you will get an error "An error occurred while running:..." You see R has failed because it is confused about the working directory. I am pretty sure there's a problem with my introduction of the "plots" directory, the R working directory being confused with the R temporary directory and the document directory. Still, in the shell I can run R CMD Stangle article-2.Rnw and get the R file. I would like to add a wishlist to your bugzilla, if you think it is technically possible. I'd really like a "one step" exporter that would drop the PDF, the Rnw, the R, and the "plots" folder into the LyX document directory. pj -- Paul E. Johnson Professor, Political Science Assoc. Director 1541 Lilac Lane, Room 504 Center for Research Methods University of Kansas University of Kansas http://pj.freefaculty.org http://quant.ku.edu