How to set the default language of date in R

More info :
https://stat.ethz.ch/R-manual/R-devel/library/base/html/locales.html

You’ll get all your local variables through : sessionInfo()

Exemple From R doc :

Sys.getlocale()

Sys.getlocale(“LC_TIME”)

Set your language

Windows

  • Sys.setlocale(“LC_TIME”, “German”)
  • Sys.setlocale(“LC_TIME”, “English”)
  • Sys.setlocale(“LC_TIME”, “French”)

Other

  • Sys.setlocale(“LC_TIME”, “de”) # Solaris: details are OS-dependent
  • Sys.setlocale(“LC_TIME”, “de_DE”) # Many Unix-alikes
  • Sys.setlocale(“LC_TIME”, “de_DE.UTF-8”) # Linux, macOS, other Unix-alikes
  • Sys.setlocale(“LC_TIME”, “de_DE.utf8”) # some Linux versions

Leave a Comment