1
#' @include with_.R
2

3
# collate --------------------------------------------------------------------
4

5 1
set_collate <- function(locale) set_locale(c(LC_COLLATE = locale))[[1]]
6

7
#' Collation Order
8
#'
9
#' Temporarily change collation order by changing the value of the
10
#' `LC_COLLATE` locale.
11
#'
12
#' @template with
13
#' @param new `[character(1)]`\cr New collation order
14
#' @param .local_envir `[environment]`\cr The environment to use for scoping.
15
#' @examples
16
#'
17
#' # Modify collation order:
18
#' x <- c("bernard", "bérénice", "béatrice", "boris")
19
#' with_collate("fr_FR", sort(x))
20
#' with_collate("C", sort(x))
21
#'
22
#' @export
23
with_collate <- with_(set_collate)
24

25
#' @rdname with_collate
26
#' @export
27
local_collate <- local_(set_collate)

Read our documentation on viewing source code .

Loading