I am trying to arrange each row in a matrix with multiple columns and multiple rows. Does it exist in R? More specifically, let us set our seed to 10 and make an example matrix:
set.seed(10) example.matrix = replicate(12,runif(500000))
To order example.matrix, I would,
ordered.example = apply(example.matrix,1,order)
But it is very slow, and I would like something faster. As an analogy
rowSums(example.matrix)
Preferably
apply(example.matrix,1,sum)
Great importance.
Yaniv brandvain
source share