I have a question regarding compare elements in 2 vectors. For example, I have 2 vectors
a<-c(8, 28, 23, 21, 7, 3, 24, 6, 1, 4)
b<-c(28, 27, 8, 7, 6, 23, 21, 3, 1, 26)
Now I want to answer the question "How many elements in a are the same as element in b?"
Which mean that I have 1, 3, 6, 7, 8, 21, 23, 28 are common numbers --> 8 elements in common.
Do we have any function in R help me to answer this question? Thank you in advance.