Re: [R] sorting matrix by sets rows

2016-02-06 Thread Bert Gunter
?order is what I think you want. There is a slight wrinkle here, however. You want to sort Cluster in *increasing* order and Byers_EMT in *decreasing*, as I understand. order() will do both increasing, or both decreasing, but not differently. So a simple but inefficient way around this is to first

[R] sorting matrix by sets rows

2016-02-06 Thread Adrian Johnson
Hello: sorry I've been trying to sort a matrix to make waterfall plot using barplot function. I have have 30x5 matrix.Rows are samples and columns are results for a test as numeric vector. I want sort matrix by column. For example, first I want to sort column 1, in decreasing values where col