I have a dataframe were the first column is called id (1, 2, 3, 4, 5, etc.) and corresponds to a dive. Another column specifies the dive type which can be F and NF.
I have another dataframe that includes the id of all NF dives that are dubious and should be eliminated from the analysis.
How can I eliminate the rows in the first dataframe that have an id that is included in the second dataframe?
Example:
> df1
id dive_type
1 F
2 F
3 NF
4 F
5 F
6 F
7 NF
8 F
> df2
id dive_type
1 F
2 F
5 F
8 F
My goal is to delete all id's in df1 that are present in df2 (in this case id's 1, 2, 5 and 8) and get something like this:
> res
id dive_type
3 NF
4 F
6 F
7 NF
Thanks