with_collate: Collation Order

Description Usage Arguments Value See Also Examples

Description

Temporarily change collation order by changing the value of the LC_COLLATE locale.

Usage

1
2
3
with_collate(new, code)

local_collate(new, .local_envir = parent.frame())

Arguments

new

[character(1)]
New collation order

code

[any]
Code to execute in the temporary environment

.local_envir

[environment]
The environment to use for scoping.

Value

[any]
The results of the evaluation of the code argument.

See Also

withr for examples

Examples

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

jimhester/withr documentation built on Jan. 1, 2020, 12:51 p.m.