title: Apply a function to each row in a data frame in R
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/4236368/how-to-apply-a-function-to-every-row-of-a-matrix-or-a-data-frame-in-r">how to apply a function to every row of a matrix (or a data frame) in R</a></p>
  <p><a href="https://stackoverflow.com/questions/15059076/r-how-to-call-apply-like-function-on-each-row-of-dataframe-with-multiple-argum">R - how to call apply-like function on each row of dataframe with multiple arguments from each row of the df</a></p>
  </blockquote>
  
  <p>I want to apply a function to each row in a data frame, however, R applies it to each column by default. How do I force it otherwise?</p>
  <pre><code>&gt; a = as.data.frame(list(c(1,2,3),c(10,0,6)),header=T)
  &gt; a
    c.1..2..3. c.10..0..6.
  1          1          10
  2          2           0
  3          3           6
  &gt; sapply(a,min)
   c.1..2..3. c.10..0..6. 
            1           0 
  </code></pre>
  <p>I wanted something like</p>
  <pre><code>1   2
  2   0
  3   3
  </code></pre>