How am I able to subtract/match certain rows based on values of multiple columns?
So far, I've tried using %in% operator. However, this doesn't work and only gives me the logical values of columns. Here is an example:
> A
x y z
1 1 1 A
2 2 1 B
3 3 2 C
4 4 3 D
5 4 3 E
6 5 4 F
7 5 4 G
8 6 5 H
> B
x y
1 1 1
2 4 3
> A[c(1,2)] %in% B
FALSE FALSE
But I need to get the logical value of each row like this:
1 TRUE
2 FALSE
3 FALSE
4 TRUE
5 TRUE
6 FALSE
7 FALSE
8 FALSE
In order to get the following:
> A[<some logical value>, ]
1 1 1 A
4 4 3 D
5 4 3 E