title: filtering a matrix values based on numeric threshold
body: <p>I have a matrix of values called data.mat</p>
  
  <pre><code>       [1,]     [2,]   [3,]
  [1,]   0.001    0.03   0.003
  [2,]   0.100    0.02   0.001
  </code></pre>
  
  <p>I wish to keep all values that are below 0.01, so I tried:</p>
  
  <pre><code>&gt; (data.mat &lt; 0.01)
  </code></pre>
  
  <p>which retunred:</p>
  
  <pre><code>       [1,]    [2,]     [3,]
  [1,]   TRUE    FALSE    TRUE
  [2,]   FALSE   FALSE    TRUE
  </code></pre>
  
  <p>But I want to get the actual values instead of getting logical arguments. I also tried:</p>
  
  <pre><code>as.numeric(data.mat &lt; 0.01)
  </code></pre>
  
  <p>But this returned 0 and 1. Any help would be appreciated.</p>
  
  <p>Thank you.</p>