title: Multiple graphs within plot with loop
body: <p>How to get graph for each column of data.frame within one plot with loop? Must be easy just can't figure it out.</p>
  
  <p>Sample data:</p>
  
  <pre><code>rdata &lt;- data.frame(y=rnorm(1000,2,2),v1=rnorm(1000,1,1),v2=rnorm(1000,3,3),
                      v3=rnorm(1000,4,4),v4=rnorm(1000,5,5))
  </code></pre>
  
  <p>What I have tried?</p>
  
  <pre><code>library(lattice)
  
  p &lt;- par(mfrow=c(2,2))
  for(i in 2:5){
  w &lt;- xyplot(y~rdata[,i],rdata)
  print(w)
  }
  par(p)
  </code></pre>