title: Subset the multiple columns by its values in R
body: <p>My data is quite large, so I create a small matrix to better illustrate my demand.</p>
  
  <pre><code>test &lt;- matrix(c(1:3, rep(0.5,3),4:1), nrow = 1, dimnames = list(1, 1:10))
  </code></pre>
  
  <p>The matrix will like this:</p>
  
  <pre><code>   1   2   3    4    5    6   7   8   9   10
  1  1   2   3   0.5  0.5  0.5  4   3   2    1
  </code></pre>
  
  <p>I want to subset this matrix with multiple columns when its value is equal to specifc value likes 0.5:</p>
  
  <pre><code>     4    5    6   
  1   0.5  0.5  0.5 
  </code></pre>
  
  <p>Since my data would have more than 10,000 columns, I'm looking for codes that can solve my problem.</p>