Hi, I found the thread http://r.789695.n4.nabble.com/Matrix-as-input-to-xyplot-lattice-proper-extended-formula-syntax-td896948.html I used Gabor's approach and then tried to assign the plot to a variable (see below). But a Quartz device is opened... why? I don't want to have anything plot/printed, I just would like to store the plot object. Is there something like "plot = FALSE"? Cheers, Marius library(lattice) library(zoo) df <- data.frame(y = matrix(rnorm(24), nrow = 6), x = 1:6) xyplot(zoo(df[1:4], df$x), type = "p") plot.object <- xyplot(zoo(df[1:4], df$x), type = "p") # problem: a Quartz device is opened (on Mac OS X 10.6)
Gabor Grothendieck
2010-Dec-21 13:40 UTC
[R] How to suppress plotting for "xyplot(zoo(x))"?
On Tue, Dec 21, 2010 at 7:53 AM, Marius Hofert <m_hofert at web.de> wrote:> Hi, > > I found the thread http://r.789695.n4.nabble.com/Matrix-as-input-to-xyplot-lattice-proper-extended-formula-syntax-td896948.html > I used Gabor's approach and then tried to assign the plot to a variable (see below). But a Quartz device is opened... why? I don't want to have anything plot/printed, I just would like to store the plot object. Is there something like "plot = FALSE"? > > Cheers, > > Marius > > library(lattice) > library(zoo) > > df <- data.frame(y = matrix(rnorm(24), nrow = 6), x = 1:6) > xyplot(zoo(df[1:4], df$x), type = "p") > > plot.object <- xyplot(zoo(df[1:4], df$x), type = "p") # problem: a Quartz device is opened (on Mac OS X 10.6)This also opens up a window on Windows. It occurs within lattice when lattice issues a trellis.par.get . A workaround would be to open a device directed to null. On Windows this would work. I assume if you use "/dev/null" it would work on your machine. png("NUL") plot.object <- ... dev.off() -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
Reasonably Related Threads
- lattice: strange behavior (?) when using trellis.device(color=FALSE)
- How to set an argument such that a function treats it as missing?
- How to create an array of lists of multiple components?
- Remove "gray grid" from levelplot
- Alignment and Labeling of a color key in a xyplot?