multiple selected varibales shouldn't have different values based on order for example, 1|2 euqal to 2|1. This function short the numbers

sort_muti_selection_var(var)

Arguments

var

variable you want to sort

Examples

df <- tibble(col = c("{1|2}", "{2|1}", "{3|2|1}", "{2|3|1}", "{2|1|3}"))
df %>% mutate(new = sort_muti_selection_var(col))
#> Error in mutate(., new = sort_muti_selection_var(col)):  In argument: `new = sort_muti_selection_var(col)`.
#> Caused by error in `str_extract_all()`:
#> ! could not find function "str_extract_all"