I have an R function which returns a cumulative frequency table, however the row values are qualitative data and I need them in a certain order.
The values for my variable in the order I would like are in a text format as follows
None
0 < x < 5
5 < x < 10
10 < x < 20
More than 20
However the function above returns a table in the order
var | frequency |
---|---|
0 < x < 5 |
2 |
5 < x < 10 |
5 |
10 < x < 20 |
5 |
More than 20 | 10 |
None | 30 |
I’ve tried using order and c “none”, “0 < x < 5” etc but I just can’t quite get it to work.