Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

During startup - Warning message: Setting LC_CTYPE= failed on Windows

Tags:

windows

r

rstudio

I have the following warning message after upgrading windows 10 whenever I launch Rstudio.

During startup - Warning message: Setting LC_CTYPE= failed

I'm running currently Microsoft R Open version.

Is there a way I could fix this warning message, I found some solutions for Mac at stackoverflow but not for Windows.

like image 664
moth Avatar asked Jan 09 '19 03:01

moth


1 Answers

The best workaround I found for that issue is to set up a .Renviron file and overwrite the locales there.

How to set and modify the .Renviron file is described i.e. in the regarding chaper of the open book Efficient R Programming. Therefore, one needs just to copy the lines

user_renviron = path.expand(file.path("~", ".Renviron"))
file.edit(user_renviron) # open with another text editor if this fails

and afterwards edit the .Renviron file to change the locale. Note that regarding on the OS some locales won't exist and it might be non trivial to install them. However, the locale "C" should always exist. For me also "English_United States.1252" worked on Windows and I added the following lines (including a linebreak) to the .Renviron file

LC_COLLATE  = "English_United States.1252"
LC_CTYPE    = "English_United States.1252"
LC_MONETARY = "English_United States.1252"
LC_NUMERIC  = "English_United States.1252"
LC_TIME     = "English_United States.1252"

like image 57
Taz Avatar answered Oct 21 '22 17:10

Taz