title: Select rows where all values are TRUE by group, using data.table
body: <p>I have data with a grouping variable 'group' and a logical variable 'logic'.</p>
  <pre><code>library(data.table)
  library(dplyr)
  
  dt &lt;- data.table(
      logic = c(TRUE, TRUE, FALSE, TRUE, TRUE, TRUE),
      group = c(&quot;A&quot; , &quot;A&quot;,  &quot;A&quot;  , &quot;B&quot; , &quot;B&quot; , &quot;B&quot;)
  )
  </code></pre>
  <p>I would like to filter groups, where <code>all</code> values in the 'logic' column are <code>TRUE</code>.</p>
  <p><code>dplyr</code> works as expected, and keeps only <code>group = B</code></p>
  <pre><code>dt %&gt;% 
    group_by(group) %&gt;% 
    filter(all(logic))
  # Source: local data table [3 x 2]
  # Groups: group
  
  #   logic group
  # 1  TRUE     B
  # 2  TRUE     B
  # 3  TRUE     B
  </code></pre>
  <p>However, my attempts with <code>data.table</code> have failed, either bringing all table or nothing.</p>
  <pre><code>dt[all(logic), group, by = group]
  # Empty data.table (0 rows) of 2 cols: group,group
  
  dt[all(.SD$logic), group,by = group]
  #    group group
  # 1:     A     A
  # 2:     B     B
  </code></pre>