I have two datasets
z <- read.csv(text="ID,Value
1,4
2,6
3,13")
x <- read.csv(text="ID,Value,Key
1,4,2
1,5,5
1,6,7
1,8,1
1,4,5
1,9,2
1,2,9
1,4,5
2,6,1
2,1,4
2,1,8
2,2,3
2,6,5
3,13,5
3,1,4
3,12,1
3,10,4
3,13,3")
This is a very simplified dataset. My original data has over 100 different ID's. I want to keep only the rows in x
that contain the same Value
in z
for each ID. I'd like for a solution that can extend to any number of ID's
. Thanks.