I made a frequency table which have overlapping strata, which lead to data as follows:
dat <- structure(list(`[0,25)` = 5L, `[100,250)` = 43L, `[100,500)` = 0L,
`[1000,1000000]` = 20L, `[1000,1500)` = 0L, `[1500,3000)` = 0L,
`[25,100)` = 38L, `[25,50)` = 0L, `[250,500)` = 27L, `[3000,1000000]` = 0L,
`[50,100)` = 0L, `[500,1000)` = 44L, `[500,1000000]` = 0L), row.names = "Type_A", class = "data.frame")
The brackets, which are the column names of dat
are in alphabetical order. I need them to be in numerical order, but I find it quite tricky.
Desired order:
[0,25), [25,50), [25,100), [50,100), ..., [3000,1000000]
What would be the best way to do this?