<I was not sure if this should go to R-devel or R-help. If I e-mailed this to the wrong place, please let me know.>
Hello dear R-devel members, I came by an oddity, with regards to how character variables are being transformed when they are in Hebrew, and when Sys.setlocale is changed. Here is an example: # first, let's set the locale to Hebrew Sys.setlocale("LC_ALL", "Hebrew") # Setting locale x <- "ש×××" # Now let's put "Peace" (in Hebrew) into variable x > x #[1] "ש×××" # it is still correctly preserved Sys.setlocale("LC_ALL", "English") # let's change the local y <- "ש×××" # Now let's enter "peace" to variable y x ; y # comparing variables x and y shows that x was changed while y wasn't #[1] "ùìåÃ" #[1] "ש×××" # Do we want them to be different? # Now If we run Sys.setlocale again, we won't see any change in y or x: Sys.setlocale("LC_ALL", "English") x ; y #[1] "ùìåÃ" #[1] "ש×××" # while if we run it in Hebrew Sys.setlocale("LC_ALL", "Hebrew") x ; y # it will change x but not y #[1] "ש×××" #[1] "ש×××" # and changing this back to English will only change x but not y Sys.setlocale("LC_ALL", "English") x ; y #[1] "ùìåÃ" #[1] "ש×××" This leads me to two questions: 1) Is this a desired property of Sys.setlocale (or of the storage system of the variables in R) ? 2) Is there a function that can change x to be like y? Thanks, Tal ----------------Contact Details:------------------------------------------------------- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- [[alternative HTML version deleted]]
______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel