Considering:
q1 <- data.frame(COD = 1:5, CLAS=letters[1:5])
q2 <- data.frame(COD = c(25,1,31,3,2), CLAS=c(45,letters[1],100,letters[3],letters[10]))
I need to know which lines are common between the data frames, taking into account that the entire line must be the same. Is there a function that returns the index from q1 to q2, or vice versa?
In the case of q1
to q2
, lines 1 and 3 are in 2 and 4. Or lines 2 and 4 of q2
are equal to 1 and 3 of q1
.
How can I make this comparison?