Removing rows based on column in another dataframe
<p>Is there a way to remove rows from a dataframe, based on the column of another dataframe? </p>

<p>For example, Dataframe 1: </p>

<pre><code>        Gene CHROM    POS REF ALT N_INFORMATIVE     Test       Beta       SE
AAA     1  15211   T   G          1481  1:15211 -0.0599805 0.112445
LLL     1 762061   T   A          1481 1:762061  0.2144100 0.427085
CCC     1 762109   C   T          1481 1:762109  0.2847510 0.204255
DDD     1 762273   G   A          1481 1:762273  0.0443946 0.119924
</code></pre>

<p>Dataframe 2 (only 1 column): </p>

<pre><code>Genes
AAA
BBB
CCC
DDD
EEE
FFF
</code></pre>

<p>In this situtation, I want to scan Dataframe 1, column 1 for any matches to Dataframe 2, and remove matching rows. </p>

<p>They need to be an exact match, and the result would look like this: </p>

<pre><code>        Gene CHROM    POS REF ALT N_INFORMATIVE     Test       Beta       SE
LLL     1 762061   T   A          1481 1:762061  0.2144100 0.427085
</code></pre>

<p>I've tried variations of this, but it hasn't worked: </p>

<pre><code>NewDataframe &lt;-!(Dataframe1$Gene==Dataframe2$Genes)
</code></pre>

<p>Thanks for reading.</p>