test1 <- as.matrix(c(1, 2, 3, 4, 5)) row.names(test1) <- c(\"a\", \"d\", \"c\", \"b\", \"e\") test2 <- as.matrix(c(6, 7, 8, 9, 10)) row.names(test2) <- c(\
test2 <- test2[rownames(test1),,drop=FALSE]