6.10 Sorting strings can be dangerous
As they depend on the system locale.
x <- c("bernard", "bérénice", "béatrice", "boris")
withr::with_locale(c(LC_COLLATE = "fr_FR"), sort(x))
#> [1] "béatrice" "bérénice" "bernard" "boris"
withr::with_locale(c(LC_COLLATE = "C"), sort(x))
#> [1] "bernard" "boris" "béatrice" "bérénice"
Avoid relying on the user’s landscape