title: Removing all occurrences from a dataframe that occur in a second dataframe
body: <p>I have two dataframes. I am looking to drop all the rows that match a second dataframe. I know there are similar questions out there but the solutions didnt work for me</p>
  <pre><code>dates &lt;- rep(seq(as.Date(&quot;2004/01/01&quot;), as.Date(&quot;2020/12/31&quot;), &quot;days&quot;), each=20)
  Animal_id &lt;- rep(1:20, times=length(unique(dates)))
  df1 &lt;- data.frame(dates=dates, id=Animal_id)
  
  dates2&lt;-rep(seq(as.Date(&quot;2004/01/01&quot;), as.Date(&quot;2020/12/31&quot;), &quot;days&quot;), each=2)
  Animal_id2&lt;-rep(1:2, times=length(unique(dates2)))
  df2&lt;- data.frame(dates=dates2, id=Animal_id2)
  df2 &lt;- df2[-4, ]
  df2 &lt;- df2[-6, ]
  
  ##I would like to ensure that there any animal in df2 is removed from df1
  
  df1$remove&lt;-paste(df1$dates,df1$id,sep=&quot;-&quot;)
  df2$remove&lt;-paste(df2$dates,df1$id,sep=&quot;-&quot;)
  
  dim(df1)
  dim(df2)
  
  
  anti_join(df1, df1, by = &quot;remove&quot;)
  </code></pre>
  <p>I have also found the following and tried but it does not work</p>
  <pre><code>df1[!(df1$remove %in% df2$remove),]
  </code></pre>
  <p>I do not get any error messages, it just simply does not remove the columns (the dimensions of the data do not change). My actual dataset is quite large and I am hoping to avoid having to type out every date+ID combo I would like to filter out.</p>
  <p>Is there a way I can get R to go through and remove matches between two dataframes when I need to do this over multiple columns (i.e. I can't just use ID because there will be differences in dates between the two)</p>