I have very large binary matrices with duplicated rows:
# create matrix M = matrix(0, 10000, 50) # randomly set up to two elements per row to one for(ii in