title: Creating New Rows based On the Count of New Rows in R
body: <p>Hi I am new to R and my data looks like this</p>
  
  <pre><code>row name units.1  units.2   units.3
         1        1       0        0
         2        0       1        0
         3        2       0        1
         4        0       0        0
  </code></pre>
  
  <p>I want to add a new row containing the count of other rows that are greater than 1, like this:</p>
  
  <pre><code>row name units.1  units.2   units.3
     1        1       0        0
     2        0       1        0
     3        2       0        1
     4        0       0        0
     5        2       1        1
  </code></pre>
  
  <p>so I can subset that later. Thanks in advance</p>
  
  <p>I also want to subset the data based on the sum of row 5, for example I want only those column whose value in row 5 is 2 or more.</p>
  
  <pre><code>   row name units.1  
         1        1       
         2        0      
         3        2      
         4        0       
         5        2       
  </code></pre>
  
  <p>Note my data has around 5K columns so I can't do this manually. Thanks again</p>