stri_locale_set: Set or Get Default Locale in 'stringi'

Description Usage Arguments Details Value See Also Examples

Description

stri_locale_set changes default locale for all functions in the stringi package, i.e. establishes the meaning of the “NULL locale” argument of locale-sensitive functions. On the other hand, stri_locale_get gets current default locale.

Usage

1
2
3

Arguments

locale

single string of the form Language, Language_Country, or Language_Country_Variant, e.g. "en_US", see stri_locale_list

Details

See stringi-locale for more information on the effect of changing default locale.

stri_locale_get is the same as stri_locale_info(NULL)$Name.

Value

stri_locale_set returns a string with previously used locale, invisibly.

stri_locale_get returns a string of the form Language, Language_Country, or Language_Country_Variant, e.g. "en_US".

See Also

Other locale_management: stri_locale_info; stri_locale_list; stringi-locale

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
oldloc <- stri_locale_set("pt_BR")
# ... some locale-dependent operations
# ... note that you may always modify a locale per-call
# ... changing default locale is convinient if you perform
# ... many operations
stri_locale_set(oldloc) # restore previous default locale

## End(Not run)

stringi documentation built on May 2, 2019, 4:54 p.m.