title: dplyr::summarise_each with count() or tally() to count number of times condition is met
body: <p>I have a dataframe with different counts of <code>1</code> in each column, like this: </p>
  
  <pre><code>dat &lt;- 
    data.frame('col1' = rep(c(0, 1), 6), 
               'col2' = rep(c(0:2), 4), 
               'col3' = rep(c(0:3), 3))
  </code></pre>
  
  <p>I'm trying to use <code>dplyr::summarise_each</code> to do the following programatically:</p>
  
  <pre><code>dat_new &lt;- 
    data.frame(tally(dat, col1 == 1), # or count()
               tally(dat, col2 == 1), 
               tally(dat, col3 == 1))
  </code></pre>
  
  <p>to give, for each column, counts of where the condition <code>rowvalue == 1</code> are met (in this case, 6, 4, and 3, respectively). However, I'm really struggling trying to do something that I think should be very easy, I would assume using <code>dplyr::summarise_each()</code>. All the help I've found online usually requires some pre-grouping, but that's not necessary in this case. Many thanks for your help</p>