[R] Sweave with layout() and loop

From: Mikkel Grum <mi2kelgrum_at_yahoo.com>
Date: Mon 27 Jun 2005 - 04:36:14 EST


When I try the following code with the Windows graphics window, a new window is opened for each multiple of four images I produce.

par(layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)), mar = c(2, 3, 2, 3))

for (i in 1:n) {
 image(... )
}

When I try to do the same with Sweave to produce a pdf document, I only get one graphic with the first four graphs. How do I get the rest when n is greater than four?

<<Plots, fig=TRUE, eps=FALSE, echo=FALSE, results=hide, width=6.8, height=9.8>>=

par(layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)), mar = c(2, 3, 2, 3))

for (i in 1:n) {
 image(... )
}

Any ideas?
cheers,
Mikkel



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 Received on Mon Jun 27 04:57:11 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST