title: How to count number of rows in data.table using same condition on multiple columns in R
body: <p>If I have the below data table in R</p>
  <pre><code>dt &lt;- data.table(x = c(&quot;No&quot;, &quot;No&quot;, &quot;Yes&quot;)
                ,  y = c(&quot;No&quot;, &quot;Yes&quot;, &quot;Yes&quot;)
                ,  z = c(&quot;No&quot;, &quot;No&quot;, &quot;No&quot;)
                ,  q = c(&quot;Hi&quot;, &quot;Where, &quot;When&quot;)
                ,  AA = c(1, 1,1)
                ,  ID = c(999, 789, 567)
                , bop = c(2345, 2222,2222))
  
  </code></pre>
  <p>and I want to get the count of <strong>&quot;No&quot;</strong> in each variable(x, y, z) in below format</p>
  <pre><code>Variable Type Count
  
   x     No      2
  
   y     No     1
  
   z     No     3
  </code></pre>
  <p>I am not able to pass the same filter to  the columns I want. I can only pass filter to one column</p>
  <pre><code>dt[, .(.N), by = .(x,y,z)]
  
  
  </code></pre>