I have a dataframe k which contains following strings in the same order:
6 to 12 months
12 to 24 months
36 to 60 months
60 to 96 months
0 to 6 months
24 to 36 months
96 to 120 months
120 months & above.
When I apply the sort
command it sorts by the integer values For eg. the string 120 months and above
is placed before 6-12 months
. Can anyone tell me how to sort it like below using some R command:
0 to 6 months
6 to 12 months
12 to 24 months
24 to 36 months
36 to 60 months
60 to 96 months
96 to 120 months
120 months & above.