0

I have to use Japanese language dataset to run my code. So I need to change the locale to japanese language.I have used the following to change it.

Sys.setlocale("LC_ALL","ja_JP.UTF8")

But there is a warning executed by the code.

In Sys.setlocale("LC_ALL", "ja_JP.UTF8") :
  OS reports request to set locale to "ja_JP.UTF8" cannot be honored

Is there any way to solve this issue?

Luiy_coder
  • 321
  • 2
  • 11
  • Maybe `Sys.setlocale("LC_ALL", "ja_JP.UTF-8")` (**you have a typo**) or `Sys.setlocale("LC_ALL","japanese_JAPAN")`. – Rui Barradas Feb 06 '20 at 08:15
  • Just one more question how much time the locale needs to be set up? – Luiy_coder Feb 06 '20 at 12:27
  • I don't understand, do you want to know for how long you will need to have that locale? I generally do something like `old_loc <- Sys.getlocale("LC_ALL")` and in the end, reset. But pay attention that `old_loc` cannot be used directly in `Sys.setlocale`, you will have to parse it. – Rui Barradas Feb 06 '20 at 12:33
  • I mean does the locale needs to be set up each time I run the code? – Luiy_coder Feb 06 '20 at 12:37
  • Yes, it does. Or you can put the `Sys.setlocale` in your Rprofile file. See [here](https://stackoverflow.com/questions/13735745/locate-the-rprofile-file-generating-default-options) and [here](https://stackoverflow.com/questions/46819684/how-to-access-and-edit-rprofile) – Rui Barradas Feb 06 '20 at 12:53

0 Answers0