title: R: plot in a grid layout over multiple pages
body: <p>I'd like to arrange a 3x3 grid layout over 3 pages of a PDF file. I'd like to plot in arbitrary grid locations across the three pages. I know how to arrange multiple subplots using some option like <code>layout=c(3,3)</code>. I can figure out how to arrange a 3x3 layout on a single plot using the grid package, and then decide to choose which plot to use. However, I can't figure out how to lay out a 3x3 grid over 3 pages, and then choose which grid to plot in. </p>
  
  <p>I was hoping <code>grid.newpage()</code> would solve my problem, as in the following:</p>
  
  <pre><code>library(grid)
  pdf(file="griddtest.pdf",paper="letter")
  vp1 &lt;- viewport(x = 0, y = 0.5, w = 0.5, h = 0.5, just = c("left", "bottom"), 
      name = "vp1")
  vp2 &lt;- viewport(x = 0, y = 0.5, w = 0.5, h = 0.5, just = c("left", "bottom"), 
      name = "vp2")
  pushViewport(vp1)
  grid.text("Some drawing in graphics region 1 on page 1",y = 0.8)
  grid.newpage()
  pushViewport(vp2)
  grid.text("Some drawing in graphics region 2 on page 2",y = 0.8)
  dev.off()
  </code></pre>
  
  <p>but this just generates the second page (I'm guessing 'newpage' overwrites the oldpage, rather than making a new page). </p>
  
  <p>Any help would be greatly appreciated!</p>