In my console :
> format(as.Date("2010-01-01"), format="%A")
[1] "星期五"
How to get the day of week in english not in chinese?
"星期五"
is the chinese form of friday
.
it is no use to set environment in my console.
> Sys.setenv(LANG = "en")
> format(as.Date("2010-01-01"), format="%A")
[1] "星期五"
it is no use to edit /etc/Rconsole, Language=en
.
> Sys.setlocale("LC_ALL", "en_US")
[1] ""
Warning message:
In Sys.setlocale("LC_ALL", "en_US") :
OS reports request to set locale to "en_US" cannot be honored
> format(as.Date("2010-01-01"), format="%A")
[1] "星期五"
my system is :xp+r -3.0.1.
i have edited the file /etc/Rprofile.site to add some lines:
.First <- function(){
Sys.setlocale("LC_COLLATE", "English")
Sys.setlocale("LC_CTYPE", "English")
Sys.setlocale("LC_MONETARY", "English")
Sys.setlocale("LC_TIME", "English")}
is there an other way to do ? to edit some file ,not to load the commands in /etc/Rprofile.site when to start R?