If you just want two different build windows to open at the same time, use dev.new , for example.
plot(1:10) dev.new() plot(10:1)
If you want to draw two graphs in the same window, then, as Shane said, set the mfrow parameter.
par(mfrow = c(2,1)) plot(1:10) plot(10:1)
If you want to try something more advanced, you can take a look at trellis graphics or ggplot, both of which are great for creating conditional graphs (graphs in which different subsets of data are displayed in different frames).
Grid example:
library(lattice) dfr <- data.frame( x = rep(1:10, 2), y = c(1:10, 10:1), grp = rep(letters[1:2], each = 10) ) xyplot(y ~ x | grp, data = dfr)
Ggplot example. (First you need to download ggplot from CRAN.)
library(ggplot2) qplot(x, y, data = dfr, facets = grp ~ .)
Richie Cotton Nov 26 '09 at 12:06 2009-11-26 12:06
source share