title: R- keep dataframe rows only if the row name is in a list
body: <p>I have a dataframe with many columns, but the first column contains names. </p>
  
  <p>I have a list of names.</p>
  
  <p>I want to only keep rows of the dataframe if the first column's name is in my list.</p>
  
  <p>For example, if I have this as my dataframe:</p>
  
  <pre><code> names     birthday
   Alice     June
   Bob       May
   Eve       December
  </code></pre>
  
  <p>and I have this as my list:</p>
  
  <pre><code> list_of_names &lt;- c("Alice","Bob")
  </code></pre>
  
  <p>I want to get:</p>
  
  <pre><code> names     birthday
   Alice     June
   Bob       May
  </code></pre>
  
  <p>I am thinking perhaps a for loop, like this:</p>
  
  <pre><code>for (i in list_of_names) {
    #if i is in df$names, append to new df?
  }
  </code></pre>