# NOT RUN {
english(1010, UK = FALSE)
english(1010, UK = TRUE)
## The default UK setting will depend on the locale:
cat("\n", ifelse(grepl("^(en_us|english_united)",
tolower(Sys.getlocale("LC_CTYPE"))), "USA", "UK"),
"English is your default\n")
english(101) ## UK not given: deduced from options
myUK <- getOption("english.UK",
!grepl("^(en_us|english_united)",
tolower(Sys.getlocale("LC_CTYPE"))))
options(english.UK = FALSE) ## American spoken here, for now.
as.english(10001001) + (-5):5
options(english.UK = myUK) ## restore original setting.
# }
Run the code above in your browser using DataLab