title: Is there a function to calculate amount of rows based on a condition?
body: <p>Example of my dataframe:</p>
  <pre><code>ID &lt;- c(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;c&quot;,&quot;d&quot;,&quot;d&quot;,&quot;e&quot;,&quot;f&quot;,&quot;g&quot;,&quot;h&quot;)
  status &lt;- c(0,1,0,1,0,1,0,0,0,1)
  DF &lt;- data.frame(ID, status)
  </code></pre>
  <pre><code>&gt; DF
     ID status
  1   a      0
  2   b      1
  3   c      0
  4   c      1
  5   d      0
  6   d      1
  7   e      0
  8   f      0
  9   g      0
  10  h      1
  </code></pre>
  <p>I need to know how many ID there is with status number 1 and only 1. With the example DF the right answer would be 2 (IDs b and h).</p>
  <p>Unfortunately I haven´t found any function for this. Should the answer be calculated with for loop or is there a simpler way for the solution?</p>
  <p>Thanks!</p>