R locale setting problems on Mac OS X
This command seems to fix it:
defaults write org.R-project.R force.LANG en_US.UTF-8
After restarting R, no more warnings about the default locale.
user260392
Updated on September 18, 2022Comments
-
user260392 over 1 year
I'm trying to install packages in R using Mac OS X, but I keep getting
tar: Failed to set default locale
errors for any package I try. After Googling around I found that this was due to unexpected locale settings. I set them back toen_US.UTF-8
as recommended elsewhere, but still can't install packages. When I runlocale
in Terminal, I get:LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"But when I run
system("locale")
in R I get:LANG="en_US.UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C"I do remember setting some locale settings to "C" awhile ago, for some other purpose, but forget where now.
-
Ramhound about 7 yearsThis does not answer the author's question.
-
Johnny Cheesecutter about 7 yearsActually id does. I just had the same problem and just changing default locale wasn't helping. Then I realized that in one of dozens modules in my script I had Sys.setenv function which rewrited default settings.