title: How to sum up all rows except the 1st which is a factor
body: <p>I have this simple data frame:</p>
  
  <pre><code>&gt;fruits 
   X Apple Banana Orange
  1 1   5.2    5.0    4.2
  2 2   2.6    4.4    3.7
  3 3   2.7    2.4    2.7
  4 4   4.0    1.3    6.2
  5 5   6.5    3.1    4.1
  6 6   4.2    3.8    5.4
  
  &gt;str(fruits)
  'data.fram e':  6 obs. of  4 variables:
   $ X     : Factor w/ 6 levels "1","2","3","4",..: 1 2 3 4 5 6
   $ Apple : num  5.2 2.6 2.7 4 6.5 4.2
   $ Banana: num  5 4.4 2.4 1.3 3.1 3.8
   $ Orange: num  4.2 3.7 2.7 6.2 4.1 5.4
  </code></pre>
  
  <p>I need to sum all rows except the first column which is a factor. I tried to loop:</p>
  
  <pre><code>&gt;for(i in 1:nrow(fruits)) {fruits$total[i] &lt;- sum(fruits[i,-1])} print (fruits$total)
  
  Error: unexpected symbol in "for(i in 1:nrow(fruits)) {fruits$total[i] &lt;-         sum(fruits[i,-1])} print"
  </code></pre>
  
  <p>Any ideas? </p>