dplyr
dplyr copied to clipboard
Bring back legacy `arrange()` behavior with `dplyr.legacy_locale`
Follow up to #6297 and #6263
So the general idea is:
- In dplyr 1.1.0, the default behavior of both
group_by()andarrange()sort in the C locale - You can revert to legacy behavior, where both sort with the system locale, with the option
dplyr.legacy_locale = TRUE - You can override the
arrange()locale with an explicit.localeargument, ~or withdplyr.locale = "fr", but we prefer the former~ - You cannot override the C locale usage in
group_by()(unless you revert to legacy behavior)
A few other notes about this PR:
- Removed
dplyr_locale(), which is no longer useful - Default
.localetoNULLinstead ofdplyr_locale() - If multiple locale options are set, hierarchy of precedence is
.locale, ~dplyr.locale~,dplyr.legacy_locale
One question: Do we even need dplyr.locale anymore? Is being able to revert to the legacy behavior good enough? If we think dplyr.locale would stick around permanently, then it makes sense to keep it too, since I would like dplyr.legacy_locale to phase out. dplyr.locale might be useful as a permanent escape hatch for the case where you are calling something that calls arrange() for you and doesn't expose .locale. (Update: We removed dplyr.locale)
Okay I have removed support for dplyr.locale and refreshed the docs and tests to reflect that.
Also updated my original comment in this PR to reflect the new state of how arrange() and group_by() work in 1.1.0
I'm going to request one last review to ensure that this all looks good