title: Filtering rows based on partial matching between a data frame and a vector
body: <p>I have a data frame and want to filter it based on the partial match of names in the first column with the names in the vector.</p>
  
  <pre><code>nam &lt;- c('mmu_mir-1-3p','mmu_mir-1-5p','mmu-mir-3-5p','mir-4','mmu-mir-6-3p') #factor
  aa &lt;- c('12854','36','5489','54485','2563') #numeric
  df &lt;- data.frame(nam,aa)
  
  vector &lt;- c('mir-1','mir-3','mir-6')
  </code></pre>
  
  <p>I need to have rows in the new data frame where names in <code>df$nam</code> are partially matching with the names in <code>vector</code>. So <code>new_df</code> should look like this.</p>
  
  <pre><code>new_nam &lt;- c('mmu_mir-1-3p','mmu_mir-1-5p','mmu-mir-3-5p','mmu-mir-6-3p')  #factor
  new_aa &lt;- c('12854','36','5489','2563')  #numeric
  new_df &lt;- data.frame(new_nam,new_aa)
  </code></pre>