I need to find all positions in my vector corresponding to any of values of another vector:
needles <- c(4, 3, 9) hay <- c(2, 3, 4, 5, 3, 7) mymatches(
This should work:
which(hay %in% needles) # 2 3 5