vector intersect and return index
a <- c(1:10) b <- c(1,3,5,11,12,13,14) c <- intersect(a, b) index.a <- match(c, a) # [1] 1 3 5 index.b <- match(c, b) # [1] 1 2 3