powered by
Temporarily change collation order by changing the value of the LC_COLLATE locale.
LC_COLLATE
with_collate(new, code)local_collate(new = list(), .local_envir = parent.frame())
local_collate(new = list(), .local_envir = parent.frame())
[character(1)] New collation order
[character(1)]
[any] Code to execute in the temporary environment
[any]
[environment] The environment to use for scoping.
[environment]
[any] The results of the evaluation of the code argument.
code
withr for examples
withr
# NOT RUN { # Modify collation order: x <- c("bernard", "b<U+00E9>r<U+00E9>nice", "b<U+00E9>atrice", "boris") with_collate("fr_FR", sort(x)) with_collate("C", sort(x)) # }
Run the code above in your browser using DataLab