title: subset a column in data frame based on another data frame/list
body: <p>I have the following <code>table1</code> which is a data frame composed of 6 columns and 8083 rows. Below I am displaying the head of this <code>table1</code>: </p>
  
  <pre><code>|gene ID        |   prom_65|   prom_66|  amast_69|  amast_70|   p_value|
  |:--------------|---------:|---------:|---------:|---------:|---------:|
  |LdBPK_321470.1 |   24.7361|   25.2550|   31.2974|   45.4209| 0.2997430|
  |LdBPK_251900.1 |  107.3580|  112.9870|   77.4182|   86.3211| 0.0367792|
  |LdBPK_331430.1 |   72.0639|   86.1486|   68.5747|   77.8383| 0.2469355|
  |LdBPK_100640.1 |   43.8766|   53.4004|   34.0255|   38.4038| 0.1299948|
  |LdBPK_330360.1 | 2382.8700| 1871.9300| 2013.4200| 2482.0600| 0.8466225|
  |LdBPK_090870.1 |   49.6488|   53.7134|   59.1175|   66.0931| 0.0843242|
  </code></pre>
  
  <p>I have another data frame, called <code>accessions40</code> which is a list of 510 gene IDs. It is a subset of the first column of <code>table1</code> i.e. all of its values (510) are contained in the first column of <code>table1</code> (8083). The head of <code>accessions40</code> is displayed below:</p>
  
  <pre><code>|V1             |
  |:--------------|
  |LdBPK_330360.1 |
  |LdBPK_283000.1 |
  |LdBPK_360210.1 |
  |LdBPK_261550.1 |
  |LdBPK_367320.1 |
  |LdBPK_361420.1 |
  </code></pre>
  
  <p>What I want to do is the following: I want to produce a new <code>table2</code> which contains under the first column (gene ID) only the values present in <code>accessions40</code> and the corresponding values from the other five columns from <code>table1</code>. In other words, I want to subset the first column of my <code>table1</code> based on the values of <code>accessions40</code>. </p>