Re: [R] get the sorted index of elements within a column
> m <- matrix(rpois(16, 10), ncol = 4) > m [,1] [,2] [,3] [,4] [1,]9 128 11 [2,] 127 118 [3,] 12788 [4,] 11 1148 > apply(m, 2, sort) [,1] [,2] [,3] [,4] [1,]9748 [2,] 11788 [3,] 12 1188 [4,] 12
[R] get the sorted index of elements within a column
Hi all, I have matrix, A. I want to sort the elements in each column in a ascending order and output the index number their position. For example A = [,1] [,2] [,3] [,4] [1,] 135.87060 97.55820 121.07722 171.625495 [2,] 70.19811 36.64529 50.13501 6.319125 [3,] 26.8