I have a dataframe that is generated dynamically from recursive left join, how can I use the order function to apply on all columns when I don't know in advance the number of columns ? I want the result sorted first on first column, then on the second ...
In the example below, I have four columns
set.seed(123)
A <- matrix(rep(1:25,4)[order(rnorm(100))],ncol=4)
B <- A[order(A[,1],A[,2],A[,3],A[,4],decreasing=TRUE),]
So I wrote this A[,1],A[,2],A[,3],A[,4] but how do I do if I don't know the number of columns ?