How can I reorder the rows of a matrix, data.frame or vector according to another one

前端 未结 2 1573
难免孤独
难免孤独 2021-02-04 03:09
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(\         


        
2条回答
提交回复
热议问题