title: How to filter a set of value from matrix with criteria in a vector without a loop?
body: <p>I have a matrix source (A), with first column is key, and the second is value for each key.</p>
  
  <pre><code>__0_1                    22034
  __1000000000000_1        34310
  __1000000000000_2        38608
  __1000000000_1           18829
  __1000_1                 38674
  __11_november_1          21566
  __11_plus_1              35908
  __12_1                   25784
  __14_july_1              28671
  __15_may_organization_1  36358
  </code></pre>
  
  <p>And vector B is the subset of key to need assign value base on matrix A.
  B:</p>
  
  <pre><code>__14_july_1
  __1000000000_1
  _15_may_organization_1
  </code></pre>
  
  <p>Here is my code to find value for B from matrix A:</p>
  
  <pre><code>for (i in 1:length(B)){
   rlst&lt;-A[A[,1]==B[i],2];
  }
  </code></pre>
  
  <p>It work good with A &amp; B small. But my real data is very big, and for loop make me lost a lot of time.<br>
  I tried some command like %in%,subset. But it not working for my problem. 
  Please help me solve this problem without <code>for</code>.</p>