title: Dplyr - Mean for multiple columns
body: <p>I want to calculate the mean for several columns and thus create a new column for the mean using <code>dplyr</code> and without melting + merging.</p>
  <pre><code>&gt; head(growth2)
    CODE_COUNTRY CODE_PLOT IV12_ha_yr IV23_ha_yr IV34_ha_yr IV14_ha_yr IV24_ha_yr IV13_ha_yr
  1            1         6       4.10       6.97         NA         NA         NA       4.58
  2            1        17       9.88       8.75         NA         NA         NA       8.25
  3            1        30         NA         NA         NA         NA         NA         NA
  4            1        37      15.43      15.07      11.89      10.00      12.09      14.33
  5            1        41      20.21      15.01      14.72      11.31      13.27      17.09
  6            1        46      12.64      14.36      13.65       9.07      12.47      12.36
  &gt; 
  </code></pre>
  <p>I need a new column within the dataset with the mean of all the IV columns.
  I tried this:</p>
  <pre><code>growth2 %&gt;% 
    group_by(CODE_COUNTRY, CODE_PLOT) %&gt;%
    summarise(IVmean=mean(IV12_ha_yr:IV13_ha_yr, na.rm=TRUE))
  </code></pre>
  <p>And returned several errors depending on the example used, such as:</p>
  <pre><code>Error in NA_real_:NA_real_ : NA/NaN argument
  </code></pre>
  <p>or</p>
  <pre><code>Error in if (trim &gt; 0 &amp;&amp; n) { : missing value where TRUE/FALSE needed
  </code></pre>