File: with_collate.Rd

package info (click to toggle)
r-cran-withr 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 528 kB
  • sloc: sh: 10; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 886 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/collate.R
\name{with_collate}
\alias{with_collate}
\alias{local_collate}
\title{Collation Order}
\usage{
with_collate(new, code)

local_collate(new = list(), .local_envir = parent.frame())
}
\arguments{
\item{new}{\verb{[character(1)]}\cr New collation order}

\item{code}{\code{[any]}\cr Code to execute in the temporary environment}

\item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.}
}
\value{
\code{[any]}\cr The results of the evaluation of the \code{code}
argument.
}
\description{
Temporarily change collation order by changing the value of the
\code{LC_COLLATE} locale.
}
\examples{

# Modify collation order:
x <- c("bernard", "bérénice", "béatrice", "boris")
with_collate("fr_FR", sort(x))
with_collate("C", sort(x))

}
\seealso{
\code{\link{withr}} for examples
}