I have two data frames. I need to delete ids that are not matching to each other. For example, I need to deleted id 4, 7, 10's data in a and id 5, 12, 15 in b. I need to delete data from both data frames.
a:
id name
1 1 A
2 2 B
3 4 D
4 7 G
5 8 H
6 9 I
7 10 J
8 13 M
b:
rating id name
1 3 1 A
2 4 2 B
3 4 5 E
4 5 8 H
5 2 9 I
6 1 12 L
7 3 13 M
8 4 15 O
Update:
c:
rating id name
1 4 2 B
2 2 9 I
3 3 13 M
Another question, if all C's data matching B, and I want to delete C's data in B, so B will only have id 1, 5, 8, 12, 15.