icuSetCollate {base}R Documentation

Setup Collation by ICU

Description

Controls the way collation is done by ICU (an optional part of the R build).

Usage

icuSetCollate(...)

Arguments

... Named arguments, see ‘Details’.

Details

Optionally, R can be built to collate character strings by ICU (http://www.icu-project.org). For such systems, icuSetCollate can be used to tune the way collation is done. On other builds calling this function does nothing, with a warning.

Possible arguments are

Only the first three are likely to be of interest except to those with a detailed understanding of collation and specialized requirements.

Some examples are case_level="on", strength="primary" to ignore accent differences, alternate_handling="shifted" to ignore space and punctuation characters.

See Also

Comparison, sort

The ICU user guide chapter on collation (http://www.icu-project.org/userguide/Collate_Intro.html).

Examples

x <- c("Aarhus", "aarhus", "safe", "test", "Zoo")
sort(x)
icuSetCollate(case_first="upper"); sort(x)
icuSetCollate(case_first="lower"); sort(x)

icuSetCollate(locale="da_DK", case_first="default"); sort(x)
icuSetCollate(locale="et_EE"); sort(x)

[Package base version 2.8.0 Index]