title: Conditional count and group by in R
body: <p>I would like to count how many rows there are per <code>type</code> if they meet the condition <code>x == 0</code>. Sort of like a group by in SQL </p>
  
  <p>Here is an example of the data </p>
  
  <pre><code>  type    x    
  search    0 
  NULL      0 
  public    0
  search    1
  home      0
  home      1
  search    0
  </code></pre>