moth
moth

Reputation: 2379

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

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.

Upvotes: 10

Views: 5977

Answers (1)

Taz
Taz

Reputation: 556

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"

Upvotes: 5

Related Questions