I’m using R version 2.15.3 (2013-03-01) on Ubuntu 12.10. The System is in German and so is R. This comes unhandy when searching for error messages.
Executing R in xterm this way $ LANG="C" R
partially solves the issue. Then R displays everything in English. But when loading RStudio this way, the R interpreter is still in German. So I’m looking for a way to change the locale of R in R itself.
I found this: How to change language settings in R, but Sys.setenv(LANG = "en")
does’t work for me:
2+x # Fehler: Objekt 'x' nicht gefunden Sys.setenv(LANG = "en") 2+x # Fehler: Objekt 'x' nicht gefunden
I also tried Sys.setenv(LANG = "en_US.UTF-8")
with no success.
Output of Sys.getlocale()
Sys.getlocale() # [1] "LC_CTYPE=de_DE.UTF-8;LC_NUMERIC=C;LC_TIME=de_DE.UTF-8; # LC_COLLATE=de_DE.UTF-8;LC_MONETARY=de_DE.UTF-8;LC_MESSAGES=de_DE.UTF-8; # LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_DE.UTF-8; # LC_IDENTIFICATION=C"
(linebrakes added for convenience)
The goal of readr's locales is to encapsulate common options that vary between languages and localities. This includes: The names of months and days, used when parsing dates. The default time zone, used when parsing datetimes. The character encoding, used when reading non-ASCII strings.
Just had the same problem and found the solution that worked for me on Windows/Linux:
Sys.setlocale("LC_ALL","English")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With