title: How to filter a table's row based on an external vector?
body: <p>(1) I have a large table read in R with more than a 10000 of rows and 10 columns.</p>
  <p>(2) The 3rd column of the table contain the name of the hospitals. Some of them are duplicated or even more.</p>
  <p>(3) I have a vector of hospitals' name, e.g. 10 of them are needed to be study further.</p>
  <p>(4) Could you mind to teach me how to extract all the rows in step1 with the names listed in step 3?</p>
  <p>Here is a shorter example of my input file;</p>
  <pre><code>Patients Treatment Hospital Response 
  1        A         YYY      Good 
  2        B         YYY      Dead 
  3        A         ZZZ      Good 
  4        A         WWW      Good 
  5        C         UUU      Dead
  </code></pre>
  <p>I have a vector of hospital that I am interested to study further, i.e <code>YYY</code> and <code>UUU</code>.  How to generate a output table as follows with R?</p>
  <pre><code>Patients Treatment Hospital Response 
  1        A         YYY      Good 
  2        B         YYY      Dead 
  5        C         UUU      Dead
  </code></pre>