Skip to content

Instantly share code, notes, and snippets.

@megpay
Created August 15, 2022 11:42
Show Gist options
  • Save megpay/b02050f250897bb5092245c9a28eca1b to your computer and use it in GitHub Desktop.
Save megpay/b02050f250897bb5092245c9a28eca1b to your computer and use it in GitHub Desktop.
Generating new locales for R to access
# When working with R files created using locales that are not installed, this is how you generate new ones.
# Works on Ubuntu 20.04.4 LTS
# prints out locales that are already created and accessible.
locale -a
# generate a new one, for example French
locale-gen fr
# Update the locales so that R can access them
locale-update
# In R, use Sys.getlocale() to get all the locales that are available.
# Sys.setlocale("LC_ALL","fr_FR.utf8") using the locale info will set it for you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment