[R] Howto sort dataframe columns by colMeans

2007-09-04 Thread Lynn Osburn
I read from external data source containing several columns. Each column represents value of a metric. The columns are time series data. I want to sort the resulting dataframe such that the column with the largest mean is the leftmost column, descending in colMean values to the right. I see

Re: [R] Howto sort dataframe columns by colMeans

2007-09-04 Thread jim holtman
Here is one way of doing it by 'skipping' the first column which is a factor and your 'time': x - read.table(textConnection( time met-amet-bmet-c + 00:0042 18 99 + 00:0588 16 67 + 00:1080 27 84), header=TRUE) x.mean -