Sort by Phrase
Arguments
- x
character; strings to sort
- loc
number of location to sort by. For example
1_2_3_4
withloc = 3
sorts by 3.
Examples
x <- c('pop_2020_est', 'pop_white_2020', 'pop_black_2020', 'pop_white_2021')
sort_phrase(x)
#> [1] "pop_2020_est" "pop_black_2020" "pop_white_2020" "pop_white_2021"