Getting rows of a matrix which coincide with a series of vectors, without using apply
问题 My question is sort of related to my earlier question. Suppose I have one matrix and 4 vectors (can consider this another matrix, since the order of the vectors matters), and I want to get the row numbers which coincide to each vector, in order. I would like the solution to avoid repeating vectors and be as efficient as possible, since the problem is large scale. Example. set.seed(1) M = matrix(rpois(50,5),5,10) v1 = c(3, 2, 7, 7, 4, 4, 7, 4, 5, 6) v2= c(8, 6, 4, 4, 3, 8, 3, 6, 5, 6) v3= c(4,