I try to convert the built-in time series sunspots
data into an xts object and print it out with the following code:
sunspots.xts <- as.xts(sunspots)
sunspots.xts
The result looks like this
And here is my sessionInfo()
output:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese (Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xts_0.9-7 zoo_1.7-14 timeDate_3012.100
loaded via a namespace (and not attached):
[1] tools_3.3.2 grid_3.3.2 lattice_0.20-34
The months are now written in traditional chinese but I want the output to remain in english. My R environment is completely in English. I guess somehow xts knows my operating system (win 8) to be working in traditional chinese and decides to change the expression of month into traditional chinese. There are similar discussions on the site and I have tried the following:
- adding language = en to the Rconsole file (The R console is in my native language, how can I set R to English?)
- changing "Language for non-Unicode programs" to english in the windows control panel(The R console is in my native language, how can I set R to English?)
- writing Sys.setenv("LANGUAGE"="EN") in my Rprofile.site file (The R console is in German language, how can I set R to English?)
None of them works. I think it's because the question is somehow different. Your help would be greatly appreciated. Thank you.