title: Select ALL Columns | Rows of a data.table based on condition
body: <p>Two related questions:</p>
  
  <p><strong>EDIT:</strong> <em>ps. I'm looking for solutions based on <code>data.table</code>.</em></p>
  
  <p><strong>1.</strong> How to select the <strong>rows</strong> of <code>data.table</code> above a certain threshold for all columns?</p>
  
  <p><strong>2.</strong> How to select the <strong>columns</strong> of <code>data.table</code> which contain values above a certain threshold ?</p>
  
  <p>Reproducible example:</p>
  
  <pre><code>library(data.table)
  dt &lt;- data.table(V1=1:5, V2=3:7, V3=7:3)
  </code></pre>
  
  <h3>conditionally selecting all rows</h3>
  
  <pre><code># this line selects rows based on column `V1`. 
    dt[ V1 &gt; 2, ] 
  
  # I'm looking for a way to select rows based on values of all columns. My failed attempt
    dt[ names(dt) &gt; 2, ] 
  
  # *expected output*: a data.table with all columns but only with those rows where all values are `&gt; 2` 
  
  #&gt; V1 V2 V3
  #&gt; 3  5  5
  #&gt; 4  6  4
  #&gt; 5  7  3
  </code></pre>
  
  <h3>conditionally selecting all columns</h3>
  
  <pre><code># My failed attempt
    dt[, .SD, .SDcols &gt; 2 ]
  
  # *expected output*: a data.table with all rows but only with those columns where all values are `&gt; 2`
  
  #&gt;   V2 V3
  #&gt;   3  7
  #&gt;   4  6
  #&gt;   5  5
  #&gt;   6  4
  #&gt;   7  3
  </code></pre>