This is possibly a simple question, but I do not know how to order columns alphabetically.
test = data.frame(C = c(0, 2, 4, 7, 8), A = c(4, 2, 4, 7, 8), B =
Here's the obligatory dplyr answer in case somebody wants to do this with the pipe.
dplyr
test %>% select(sort(names(.)))