I was wondering whether you might consider adding a function to forcats that sets up factor levels according to a numerically-aware string-sorting method like gtools::mixedsort.
There's a number of use cases: eg, when you end up with genomes ordered like "chr1", "chr10", "chr11" ... "chr2" rather than "chr1", "chr2", ..., in a plot if you don't hack your factors correctly
`fct_sort` takes a factor or character-vector (implictly converted to factor) and reorders the `levels` of that factor using a user-specified function `.fun`.
Code added to `R/sort.R`, unit tests into `tests/testthat/test-fct_sort.R`.
An example showing how to use `fct_sort` to sort number-containing character `levels` by the contained number.