Factor variables with numbers as levels are alphabetically ordered by default, which requires rearrangements for various purposes, e.g. modelling or visualizations. This function re-orders levels of numeric factor variables numerically.
refactorNum(x, decreasing = FALSE)
A factor variable with numeric values as levels
Logical, should the levels sorted descendingly?
A factor variable, with sorted numeric values as levels