Re: [R] Sweave and multipage lattice

2006-07-20 Thread Friedrich Leisch
 On Wed, 19 Jul 2006 11:01:02 -0500,
 Sundar Dorai-Raj (SD) wrote:

   Dieter Menne wrote:
   Dear R-Listeners,
   
   as the Sweave faq says:
   
   http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html
   
   creating several figures from one figure chunk does not work, and for
   standard graphics, a workaround is given. Now I have a multipage trellis
   plot with an a-priori unknown number of pages, and I don't see an elegant
   way of dividing it up into multiple pdf-files.
   
   I noted there is a page event handler in the ... parameters, which would
   provide a handle to open/close the file.
   
   Any good idea would be appreciated.
   
   Dieter
   

   Hi, Dieter,

   I haven't seen a reply to this and I don't know Sweave. However, will 
   the following example work? It does require you know the layout for one 
   page.

   --sundar

   library(lattice)

   trellis.device(postscript, file = barley%02d.eps,
   width = 5, height = 3, onefile = FALSE,
   paper = special)
   ## from ?xyplot
   dotplot(variety ~ yield | site, data = barley, groups = year,
key = simpleKey(levels(barley$year), space = right),
xlab = Barley Yield (bushels/acre) ,
aspect=0.5, layout = c(1, 1), ylab=NULL)
   dev.off()

   files - list.files(pattern = glob2rx(barley*.eps))
   for(file in files)
  cat(\\includegraphics{, file, }\n\n, sep=)

Yes, doing the above embedded in a chunk with results=tex should do
the trick. You may need to enclose the call to dotplot() in print()
though.

Best,
Fritz

-- 
---
Prof. Dr. Friedrich Leisch 

Institut für Statistik  Tel: (+49 89) 2180 3165
Ludwig-Maximilians-Universität  Fax: (+49 89) 2180 5308
Ludwigstraße 33
D-80539 München http://www.stat.uni-muenchen.de/~leisch

__
R-help@stat.math.ethz.ch 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.


Re: [R] Sweave and multipage lattice

2006-07-19 Thread Sundar Dorai-Raj


Dieter Menne wrote:
 Dear R-Listeners,
 
 as the Sweave faq says:
 
 http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html
 
 creating several figures from one figure chunk does not work, and for
 standard graphics, a workaround is given. Now I have a multipage trellis
 plot with an a-priori unknown number of pages, and I don't see an elegant
 way of dividing it up into multiple pdf-files.
 
 I noted there is a page event handler in the ... parameters, which would
 provide a handle to open/close the file.
 
 Any good idea would be appreciated.
 
 Dieter
 

Hi, Dieter,

I haven't seen a reply to this and I don't know Sweave. However, will 
the following example work? It does require you know the layout for one 
page.

--sundar

library(lattice)

trellis.device(postscript, file = barley%02d.eps,
width = 5, height = 3, onefile = FALSE,
paper = special)
## from ?xyplot
dotplot(variety ~ yield | site, data = barley, groups = year,
 key = simpleKey(levels(barley$year), space = right),
 xlab = Barley Yield (bushels/acre) ,
 aspect=0.5, layout = c(1, 1), ylab=NULL)
dev.off()

files - list.files(pattern = glob2rx(barley*.eps))
for(file in files)
   cat(\\includegraphics{, file, }\n\n, sep=)

__
R-help@stat.math.ethz.ch 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.


Re: [R] Sweave and multipage lattice

2006-07-19 Thread Joel kincaid
On 7/18/06, Dieter Menne [EMAIL PROTECTED] wrote:
 Dear R-Listeners,

 as the Sweave faq says:

 http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html

 creating several figures from one figure chunk does not work, and for
 standard graphics, a workaround is given. Now I have a multipage trellis
 plot with an a-priori unknown number of pages, and I don't see an elegant
 way of dividing it up into multiple pdf-files.

try searching the listserv for the following message title (no quotes):
Sweave and Printing Lattice Figures From Loop
In that message I report code and give a snw file that you can try
out. Its very long and not well written, but it got the job done for
megood luck


-- 
Joel F. Kincaid
Associate Professor of Economics
School of Business and Economics
Winston Salem State University
Winston-Salem, NC 27110
Telephone: (336) 750-2348
Fax: (336) 750-2335

__
R-help@stat.math.ethz.ch 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.


[R] Sweave and multipage lattice

2006-07-18 Thread Dieter Menne
Dear R-Listeners,

as the Sweave faq says:

http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html

creating several figures from one figure chunk does not work, and for
standard graphics, a workaround is given. Now I have a multipage trellis
plot with an a-priori unknown number of pages, and I don't see an elegant
way of dividing it up into multiple pdf-files.

I noted there is a page event handler in the ... parameters, which would
provide a handle to open/close the file.

Any good idea would be appreciated.

Dieter

__
R-help@stat.math.ethz.ch 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.