Assume a matrix that contains all bit strings of length
r and is in order.
library(gtools) mat<-permutations(n = 2, r = 5, v = c(0,1), repeats.allowed = TRUE) mat<-cbind(mat, round(runif(nrow(mat)), digits = 2))
and several vectors each with
For each vector (i.e, row in
vec) I would like to identify the corresponding row in
Note: I would like to list the result for each row, not just the
Is there an efficient way to do this without using a for loop?