Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Michael Friendly
Just a follow-up on this thread, now with R 2.11.1. I was happy back then to use Deepayan's solution for this, under earlier R versions; but it now gives an error and the Sweave-generated .tex file no longer compiles. ortho-xyplot1-code, keep.source=TRUE, eval=FALSE= library(nlme)

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Duncan Murdoch
On 12/09/2010 11:41 AM, Michael Friendly wrote: Just a follow-up on this thread, now with R 2.11.1. I was happy back then to use Deepayan's solution for this, under earlier R versions; but it now gives an error and the Sweave-generated .tex file no longer compiles. ortho-xyplot1-code,

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Deepayan Sarkar
On Sun, Sep 12, 2010 at 8:47 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 12/09/2010 11:41 AM, Michael Friendly wrote: Just a follow-up on this thread, now with R 2.11.1. I was happy back then to use Deepayan's solution for this, under earlier R versions; but it now gives an error

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Michael Friendly
Thanks Deepayan and Duncan. The eval=FALSE was the problem, rather than anything with lattice. Not sure why that worked earlier, but I no longer care. -Michael Deepayan Sarkar wrote: On Sun, Sep 12, 2010 at 8:47 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 12/09/2010 11:41 AM,

[R] Sweave: infelicities with lattice graphics

2010-07-15 Thread Michael Friendly
In a paper I'm writing using Sweave, I make use of lattice graphics, but don't want to explicitly show (or explain) in the article text the print() wrapper I need in code chunks for the graphs to appear. I can solve this by including each chunk twice, with different options, as in

Re: [R] Sweave: infelicities with lattice graphics

2010-07-15 Thread Duncan Murdoch
On 15/07/2010 4:51 PM, Michael Friendly wrote: In a paper I'm writing using Sweave, I make use of lattice graphics, but don't want to explicitly show (or explain) in the article text the print() wrapper I need in code chunks for the graphs to appear. I can solve this by including each chunk

Re: [R] Sweave: infelicities with lattice graphics

2010-07-15 Thread Claudia Beleites
Dear Michael, I know this situation from writing vignettes and I usually cheat a bit I redefine the functions along these lines: plotmap - function (...) print (hyperSpec:::plotmap (...)) (plotmap is a lattice-function for hyperSpec objects) plotmap can tehn be used without the print in

Re: [R] Sweave: infelicities with lattice graphics

2010-07-15 Thread carslaw
I have wondered about this too. The approach I use isn't pretty but does have a couple of advantages - there is only one set of code to run and I have control over the figure size. The first part of the code below is what is shown in the document (but not run), and the second part actually

Re: [R] Sweave: infelicities with lattice graphics

2010-07-15 Thread Claudia Beleites
Dear David, you can use Gin: \setkeys{Gin}{width=0.5\linewidth} just before the chunk that actually produces the figure. and, cool, I hadn't realized, that fig = TRUE, echo = FALSE= print ( chunk-with-lattice-function ) @ works. with {} inside the print there can be even more than

Re: [R] Sweave: infelicities with lattice graphics

2010-07-15 Thread Deepayan Sarkar
On Thu, Jul 15, 2010 at 1:51 PM, Michael Friendly frien...@yorku.ca wrote: In a paper I'm writing using Sweave, I make use of lattice graphics, but don't want to explicitly show (or explain) in the article text the print() wrapper I need in code chunks for the graphs to appear. I can solve