[R] lattice layout multiple pages

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sun Nov 19 10:24:49 CET 2006


Thanks a lot to Deepayan Sarkar, Prof. Bryan Ripley and R François (the 
latter off list),

To recap after trial (for further users who may want to search the 
r-help list):

grid::grid.prompt(TRUE)
xyplot(pds~time|Idnid,data=croispond3,layout=c(4,4))
(and FALSE to restore).

is exactly what I need... Now I have just to copy one hundred times 
"lattice is based on grid and not on graphics" to keep that in mind (I 
knew it!!!).

Regarding win.metafile(), those two options make it:

win.metafile("Rplot%d.emf")
xyplot(pds~time|Idnid,data=croispond3,layout=c(4,4))
dev.off()

win.metafile("Rplot%02d.emf")
xyplot(pds~time|Idnid,data=croispond3,layout=c(4,4))
dev.off()

The second inserts a number on two digits ("01", "02", "03", etc...) and 
the image are thus sorted from the first to the last in the folder 
including when there are 10 images and more.

Thanks again,

Patrick








Prof Brian Ripley a écrit :
> On Sat, 18 Nov 2006, Deepayan Sarkar wrote:
>
>> On 11/18/06, Patrick Giraudoux <patrick.giraudoux at univ-fcomte.fr> wrote:
>
> [...]
>
>>> Also I would like to print those pages to a device (eg using
>>> win.metafile(filename = "myfile")), but I wonder how to manage not to
>>> make each page file created overwritten by the next one in this 
>>> context.
>>
>> Don't know about win.metafile (have you tried it? Does it really
>> overwrite previous pages?), but pdf etc have options (described in
>> their help page) to produce either a single multi-page files or
>> multiple single-page files.
>
> So does win.metafile: the only difference is that the default is the 
> clipboard, and that does hold only one page at a time. Try
>
> win.metafile("Rplot%d.emf")
>



More information about the R-help mailing list