title: Proper way to print numerous graphical objects in a loop using R?
body: <p>I often hear that, generally speaking, using <code>apply</code> functions is superior (and more <em>proper</em>) than using <code>for</code> loops in R. Does this also apply to printing graphical output (which has no desirable console output or object saving)?</p>
  
  <p>For example:</p>
  
  <p>If I want to print 5 lines on a graph do I use an apply function (e.g, <code>sapply</code>) or a <code>for</code> loop? </p>
  
  <pre><code>plot(x=1:5,y=1:5,type='n')
  sapply(1:5,function(z) lines(y = 1:5, x=rep(z, length(1:5))))  #...or....
  for(z in 1:5) { lines(y=1:5, x=rep(z, length(1:5))) }
  </code></pre>
  
  <p>The apply function creates useless console output, but I'm under the impression that <code>apply</code> is better than using a <code>for</code> loop.</p>
  
  <p>Kind of a silly question perhaps, but I'd like my code to be as clear and fast as possible.</p>
  
  <p>(Also, if neither sapply or a for loop are the best approach to coding this command, what is?)</p>