I am working with 2 data frames. I want to a file that outputs rows that appear in data frame 1, but do not appear in data frame 2. Here is sample data:
df1:
id visit
094-1 2
094-2 3
0813-1 11
0813-3 22
df2:
id visit
094-1 2
094-2 3
0819-2 8
This is what I want:
df3:
id visit
0819-2 8
I tried this, but it is not working. Can someone please help?
library(tidyverse)
df1 %in% df2 -> x
df2[!x,]-> df3