My data has more than 10 columns, an example would be the following;
I have a data frame like this
> set.seed(1)
> data.frame(`1`=rnorm(3), `2`=rnorm(3), `4`=rnorm(3), `3`=rnorm(3), check.names=FALSE)
1 2 4 3
1 -0.6264538 1.5952808 0.4874291 -0.3053884
2 0.1836433 0.3295078 0.7383247 1.5117812
3 -0.8356286 -0.8204684 0.5757814 0.3898432
And I'd like to reorder the column names in numerical order to produce this
1 2 3 4
1 -0.6264538 1.5952808 -0.3053884 0.4874291
2 0.1836433 0.3295078 1.5117812 0.7383247
3 -0.8356286 -0.8204684 0.3898432 0.5757814