Debian Codegraph @

man/with_collate.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/collate.R
3 \name{with_collate}
4 \alias{with_collate}
5 \alias{local_collate}
6 \title{Collation Order}
7 \usage{
8 with_collate(new, code)
9
10 local_collate(new = list(), .local_envir = parent.frame())
11 }
12 \arguments{
13 \item{new}{\verb{[character(1)]}\cr New collation order}
14
15 \item{code}{\code{[any]}\cr Code to execute in the temporary environment}
16
17 \item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.}
18 }
19 \value{
20 \code{[any]}\cr The results of the evaluation of the \code{code}
21 argument.
22 }
23 \description{
24 Temporarily change collation order by changing the value of the
25 \code{LC_COLLATE} locale.
26 }
27 \section{Examples}{
28
29
30 \if{html}{\out{<div class="sourceCode">}}\preformatted{# Modify collation order:
31 x <- c("bernard", "bérénice", "béatrice", "boris")
32
33 with_collate("fr_FR", sort(x))
34 #> [1] "béatrice" "bérénice" "bernard" "boris"
35
36 with_collate("C", sort(x))
37 #> [1] "bernard" "boris" "béatrice" "bérénice"
38 }\if{html}{\out{</div>}}
39 }
40
41 \seealso{
42 \code{\link{withr}} for examples
43 }