Hello all, I upgraded from R 1.8.1 to 1.9.0 (Windows XP), and spotted an odd thing. The last three letters in the Swedish alphabet are ??, ?? and ??. (In case they don't show correctly: they are a with a ring, a with two dots, and o with two dots (HTML: å ä ö). When I use these as variable names in a data.frame, odd things happen: In R 1.8.1, ?? (å) doesn't work while the others do. In R 1.9.0, ?? (ö) doesn't work while the others do. Please find examples below. It would be nice if all three could be used in variable names. At least in Sweden :-) Thanks... Sixten. # # R 1.9.0: ?? is renamed to X. #> data.frame(a=1, ??=2, ??=3, ??=4)a ?? ?? X. 1 1 2 3 4> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 9.0 year 2004 month 04 day 12 language R># # R 1.8.1: ?? is renamed to X. #> data.frame(a=1, ??=2, ??=3, ??=4)a X. ?? ?? 1 1 2 3 4> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 8.1 year 2003 month 11 day 21 language R #
Prof Brian Ripley
2004-Jun-24 07:12 UTC
[R] R 1.9.0, special characters in variable names.
This is a function of the OS set by your locale, and there is nothing we can do about it. It is done by the C call isalpha in do_makenames in src/main/character.c. My Windows XP machine in Swedish does accept all three, using the CRAN-compiled version of rw1091.exe, so something is up with yours. Sorry, can't help. On Thu, 24 Jun 2004, Sixten Borg wrote:> Hello all, > > I upgraded from R 1.8.1 to 1.9.0 (Windows XP), and spotted an odd thing. > > The last three letters in the Swedish alphabet are ??, ?? and ??. (In case they don't show correctly: they are a with a ring, a with two dots, and o with two dots (HTML: å ä ö). > > When I use these as variable names in a data.frame, odd things happen: > In R 1.8.1, ?? (å) doesn't work while the others do. > In R 1.9.0, ?? (ö) doesn't work while the others do. > > Please find examples below. It would be nice if all three could be used in variable names. At least in Sweden :-) > > Thanks... > Sixten. > > # > # R 1.9.0: ?? is renamed to X. > # > > > data.frame(a=1, ??=2, ??=3, ??=4) > a ?? ?? X. > 1 1 2 3 4 > > version > _ > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 1 > minor 9.0 > year 2004 > month 04 > day 12 > language R > > > > > # > # R 1.8.1: ?? is renamed to X. > # > > > data.frame(a=1, ??=2, ??=3, ??=4) > a X. ?? ?? > 1 1 2 3 4 > > version > _ > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 1 > minor 8.1 > year 2003 > month 11 > day 21 > language R > > > # > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
"Sixten Borg" <sb at ihe.se> writes:> Hello all, > > I upgraded from R 1.8.1 to 1.9.0 (Windows XP), and spotted an odd thing. > > The last three letters in the Swedish alphabet are ??, ?? and ??. (In case they don't show correctly: they are a with a ring, a with two dots, and o with two dots (HTML: å ä ö). > > When I use these as variable names in a data.frame, odd things happen: > In R 1.8.1, ?? (å) doesn't work while the others do. > In R 1.9.0, ?? (ö) doesn't work while the others do. > > Please find examples below. It would be nice if all three could be used in variable names. At least in Sweden :-)I suspect this is an OS/locale issue rather than an R one -- we're at the mercy of whatever the isprint function/macro returns for a given locale. Works fine on Linux with LC_CTYPE=da_DK> > data.frame(a=1, ??=2, ??=3, ??=4) > a ?? ?? X. > 1 1 2 3 4> data.frame(a=1, ??=2, ??=3, ??=4, ??=5, ??=6)a ?? ?? ?? ?? ?? 1 1 2 3 4 5 6 (1.9.0 on RH8) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Ingolfsson, Olafur
2004-Jun-24 07:59 UTC
[R] R 1.9.0, special characters in variable names.
"Sixten Borg" <sb at ihe.se> writes: When I use these as variable names in a data.frame, odd things happen:> data.frame(a=1, ??=2, ??=3, ??=4) > a ?? ?? X. > 1 1 2 3 4---- I your variables only include numbers (or only characters), this works XX <- cbind(a=1, ??=2, ??=3, ??=4, ??=5, ??=6)> XXa ?? ?? ?? ?? ?? [1,] 1 2 3 4 5 6 But this doesn't> data.frame(XX)a ?? ?? X. X?? X. 1 1 2 3 4 5 6 i.e. it is the data.frame function that manages to mess up the variable names for us Windows users
Seemingly Similar Threads
- Firefox won''t let me send ''&'' with AJAX!
- Localization problems with leeding html escaped ÅÄÖ
- R crashes when loading library/package; Windows, Cygwin
- "incompatible character encodings: ASCII-8BIT and UTF-8"
- Summary R 1.9.0, special characters in variable names.