Re: [R] two lattice graphs in one object

2008-09-03 Thread Deepayan Sarkar
On Tue, Sep 2, 2008 at 11:43 PM, Andreas Krause <[EMAIL PROTECTED]> wrote: > Deepayan, > > that is exactly what I was hoping for. Thanks much! > > Experimenting with it I noticed that updating two existing objects with plot > arguments seems to not work, at least not in this way: > > gr1 <-xyplot(

Re: [R] two lattice graphs in one object

2008-09-03 Thread Felix Andrews
By the way, a different approach, with a different result, is to use c.trellis from the latticeExtra package: library(latticeExtra) ... return(c(gr1, gr2)) This merges the panels into a single trellis object. Note that there are complications with things like titles, legends and strips. -Felix

Re: [R] two lattice graphs in one object

2008-09-03 Thread Andreas Krause
Deepayan, that is exactly what I was hoping for. Thanks much! Experimenting with it I noticed that updating two existing objects with plot arguments seems to not work, at least not in this way: gr1 <-xyplot(rnorm(111) ~ runif(111), main = "Plot A") gr2 <- xyplot(runif(111) ~ runif(111), main =

Re: [R] two lattice graphs in one object

2008-09-02 Thread Deepayan Sarkar
On Tue, Sep 2, 2008 at 6:24 AM, Andreas Krause <[EMAIL PROTECTED]> wrote: > > When I create a lattice/Trellis type graph, I typically write a function that > returns the graph, as in > do.graph <- function(x, y, ...) > { >require(lattice) >return(xyplot(y~x, ...)) > } > > My question tod

[R] two lattice graphs in one object

2008-09-02 Thread Andreas Krause
When I create a lattice/Trellis type graph, I typically write a function that returns the graph, as in do.graph <- function(x, y, ...) { require(lattice) return(xyplot(y~x, ...)) } My question today is this: If I want two graphs on one page, one way of achieving it is to print the