title: RowSums conditional on value
body: <p>I'm rather new to r and have a question that seems pretty straight-forward.
  I want to do rowSums but to only include in the sum values within a specific range (e.g., higher than 0). </p>
  
  <p>e.g. - with the last column being the requested sum </p>
  
  <pre><code>  col1  col2  col3  col4 totyearly
  1   -5     3     4    NA      7
  2    1     40   -17   -3     41
  3   NA     NA    -2   -5      0
  4   NA     1      1    1      3  
  </code></pre>
  
  <p>What I currently have is:</p>
  
  <pre><code>df$totyearly &lt;- rowSums(df[, 1:4], na.rm=TRUE)
  </code></pre>
  
  <p>How do I add the condition re positive values? </p>