title: How to count number of values by condition in dataframe?
body: <p>From this dataframe I need to count number of TRUE and FALSE values by columns. However, since I need to automatize the process I cant count them with column names or column indexes. I need something else</p>
  <pre><code>df1  &lt;- c(TRUE,TRUE,FALSE,TRUE,TRUE)
  df2 &lt;- c(TRUE,FALSE,FALSE,TRUE,TRUE)
  df3 &lt;- c(FALSE,TRUE,TRUE,TRUE,TRUE)
  
  df &lt;- data.frame(df1,df2,df3)
  </code></pre>
  <p>Expected outcome:</p>
  <pre><code>      df1    df2    df3
   TRUE   4      3      4
  FALSE   1      2      1
  </code></pre>