This may be a simple question, but I don't know how to sort the columns alphabetically.
test = data.frame(C = c(0, 2, 4, 7, 8), A = c(4, 2, 4, 7, 8), B = c(1, 3, 8, 3, 2))
I like to order columns by column names in alphabetical order to achieve
# ABC
For others, I want my own specific order:
# BAC
Please note that my datasets are huge, with 10,000 variables. Therefore, the process should be more automated.
sorting r dataset
John Clark Sep 07 '11 at 13:27 2011-09-07 13:27
source share