Displaying 1 result from an estimated 1 matches for "ordered_list".
2009 Jan 27
2
sorting matrix to match an ordered list
Hi all,
This can't be very hard, but it is sticking me because I am a beginner.
Setup:
x = rbind(c(0,1,1), c(2,3,1), c(4,5,1))
y = as.matrix(x)
rownames(y) = c("a","b","c")
colnames(y) = c("a","b","c")
ordered_list = c("b", "c", "a")
How do I produce a new matrix, z, with the rows and columns both sorted
in the order specified by ordered_list?
(I have a big 124x124 output matrix that comes out with the rows &
columns in alphabetical order, I want them in a pre-specified o...