I would like to subset the data of one matrix using data in a second matrix. The columns of one matrix is labeled. For example,
area1 <- c(9836374,635440,230
split(as.data.frame(mat1), apply(mat2, 1, paste, collapse = " "))
#$`1 2 5`
# a1 a2 a3
#1 9836374 635440 23018
#3 879042 220539 870581
#4 217418 552303 269359
#5 833696 936079 1472449
#
#$`30 31 34`
# a1 a2 a3
#2 833696 936079 1472449
#6 879042 220539 870581
#
#$`51 52 55`
# a1 a2 a3
#7 833696 936079 1472449
#
#$`81 82 85`
# a1 a2 a3
#8 879042 220539 870581