I am working with the R programming language. Suppose I have these two data frames:
data_one
col1 col2
1 a aa
2 a bb
3 a bd
4 b cc
data_two
col1 col2
1 a aa
2 b cc
I am trying to "remove" the rows in "data_one" that are also found in "data_two". This would look something like this:
col1 col2
2 a bb
3 a bd
I tried to do this with the dplyr library:
library(dplyr)
library(dplyr)
anti_join(data_one, data_two)
Joining, by = c("col1", "col2")
col1 col2
1 a bb
2 a bd
Question: In general, is this the correct way to substract rows in "data_one" that are also found in "data_two" ?
Thanks