powered by
sort_mat(x)
nth, colMaxs, colMins
x <- matrix( rnorm(1000 * 20), ncol = 20 ) system.time( s1 <- sort_mat(x) ) system.time( s2 <- apply(x, 2, sort) ) all.equal(as.vector(s1), as.vector(s2))
Run the code above in your browser using DataLab