title: R Programming Calculate Rows Average
body: <p>How to use R to calculate row mean ?</p>
  
  <p>Sample data:</p>
  
  <p><img src="https://i.stack.imgur.com/aVVbn.png" alt="enter image description here"></p>
  
  <pre><code>f&lt;- data.frame(
    name=c("apple","orange","banana"),
    day1sales=c(2,5,4),
    day1sales=c(2,8,6),
    day1sales=c(2,15,24),
    day1sales=c(22,51,13),
    day1sales=c(5,8,7)
  )
  </code></pre>
  
  <p>Expected Results :</p>
  
  <p><img src="https://i.stack.imgur.com/CG8di.png" alt="enter image description here"></p>
  
  <p>Subsequently the table will add more column for example the expected results is only until AverageSales <code>day1sales.4</code>. After running more data, it will add on to <code>day1sales.6</code> and so on. So how can I count the average for all the rows?</p>