Under Mac OSX, for the general default, normally I start the terminal and use ls -al
to check the availability of the .bash_profile and then use nano .bash_profile
to add the necessary global default into it.
But for R and Rstudio, if I want to set the global default for the input of the Chinese character with command Sys.setlocale(category = "LC_ALL", locale = "zh_cn.utf-8")
. I use the following command to get the R_HOME
R.home()
[1] "/Library/Frameworks/R.framework/Resources"
Then I copy the command Sys.setlocale(category = "LC_ALL", locale = "zh_cn.utf-8")
into the newly created file named either .Rprofile or "Rprofile.site in the directory "/Library/Frameworks/R.framework/Resources/etc", but it seems not work for me, what's wrong for my steps?
There is a close anwer to my question locate the ".Rprofile" file generating default options
What's the difference between .Rprofile and Rprofile.site?
Sys.setlocale(category = "LC_ALL", locale = "zh_cn.utf-8")
. the following link offers a good explanation for this csgillespie.github.io/efficientR/3-3-r-startup.html#r-startupfile.path
has no effect in your code.