R/push-locale.R

Defines functions push.locale restore.locale

push.locale <- function(newlocale,LC_STRINGS=c("LC_CTYPE","LC_COLLATE")){
  oldlocale <- lapply(LC_STRINGS,Sys.getlocale)
  for(lstr in LC_STRINGS)
    Sys.setlocale(category=lstr,locale=newlocale)
  return(oldlocale)
}

restore.locale <- function(loclist){
  for(n in names(loclist))
    Sys.setlocale(category=n,locale=loclist[[n]])
}

Try the codebooks package in your browser

Any scripts or data that you put into this service are public.

codebooks documentation built on May 2, 2019, 5:26 p.m.