title: For each row in an R dataframe
body: <p>I have a dataframe, and for each row in that dataframe I have to do some complicated lookups and append some data to a file.</p>
  
  <p>The dataFrame contains scientific results for selected wells from 96 well plates used in biological research so I want to do something like:</p>
  
  <pre><code>for (well in dataFrame) {
    wellName &lt;- well$name    # string like "H1"
    plateName &lt;- well$plate  # string like "plate67"
    wellID &lt;- getWellID(wellName, plateName)
    cat(paste(wellID, well$value1, well$value2, sep=","), file=outputFile)
  }
  </code></pre>
  
  <p>In my procedural world, I'd do something like:</p>
  
  <pre><code>for (row in dataFrame) {
      #look up stuff using data from the row
      #write stuff to the file
  }
  </code></pre>
  
  <p>What is the "R way" to do this?</p>