Dear R-users, Some hours ago I successfully installed R 1.7.1 on my Linux computer (SuSE 8.1). Now I am trying to get my scripts work which I have written for R/Windows. * While with Windows I was able to use the vowels with the accents present in the Hungarian language: > d$crude.inc<-d$esetsz?m/d$?vk?zepi.l?leksz?m*1000000 > the same line leads to an error on Linux: > d$crude.inc<-d$esetsz?m/d$?vk?zepi.l?leksz?m*1000000 Error: syntax error > * This must be a difference in the behaviour of R, not the operating system because the following tests passed (even with a filename!) : > t<-"?vk?zepi.l?leksz?m" > t [1] "?vk?zepi.l?leksz?m" > filename<-"csoportok_l?lek_?s_esetsz?mai.csv" > d=read.csv2(filename) > The special characters are accepted inside strings, but not as names of variables. Could you tell me what to set in R to make it accept these special characters as names? Thank you, G?bor -- Gabor BORGULYA MD MSc Semmelweis University of Budapest, 2nd Dept of Paediatrics Hungarian Paediatric Cancer Registry phone: +36 - 1 - 4591500 / 2834
BORGULYA G?bor <borgulya at gyer2.sote.hu> writes:> Dear R-users, > > Some hours ago I successfully installed R 1.7.1 on my Linux computer > (SuSE 8.1). Now I am trying to get my scripts work which I have > written for R/Windows. > > * While with Windows I was able to use the vowels with the accents > present in the Hungarian language: > > > d$crude.inc<-d$esetsz?m/d$?vk?zepi.l?leksz?m*1000000 > > > > the same line leads to an error on Linux: > > > d$crude.inc<-d$esetsz?m/d$?vk?zepi.l?leksz?m*1000000 > Error: syntax error > >This is generally a locale problem, specifically, LC_CTYPE needs to be set so that (AFAIR) isprint() returns true on the printable characters in Hungarian locale. Actually, most of the iso-8859 locales will do (Does Hungarian use iso-8859-1 or -2, BTW?), e.g. for me> d$crude.inc<-d$esetsz?m/d$?vk?zepi.l?leksz?m*1000000Error: Object "d" not found> Sys.getenv("LC_CTYPE")LC_CTYPE "da_DK" (NB: no syntax error in that, just a complaint that I didn't define d). A fair guess is that you want to set export LC_CTYPE=hu_HU in your .profile, or systemwide wherever SuSE wants you to put it. You can also set LANG or LC_ALL, although I choose not to because it upsets other parts of the system (error messages, collating sequence, etc.) -- 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
Dear Tam?s and Peter, Thank you for your suggestions. Both of you wrote about modifying the value of the LC_ALL environment variable (or even the LANG or LC_ALL) in the .bashrc file. First I modified the .bashrc, but it didn't change the result. I guessed that modifying .profile might have a stronger influence on the system, but the problem is still unsolved: ------------ .profile ---------------- export LANG=hu_HU export LC_ALL=hu_HU -------------------------------------- gab at gyoh:~> locale LANG=hu_HU LC_CTYPE="hu_HU" LC_NUMERIC="hu_HU" LC_TIME="hu_HU" LC_COLLATE="hu_HU" LC_MONETARY="hu_HU" LC_MESSAGES="hu_HU" LC_PAPER="hu_HU" LC_NAME="hu_HU" LC_ADDRESS="hu_HU" LC_TELEPHONE="hu_HU" LC_MEASUREMENT="hu_HU" LC_IDENTIFICATION="hu_HU" LC_ALL=hu_HU gab at gyoh:~> R R : Copyright 2003, The R Development Core Team Version 1.7.1 (2003-06-16) > xy Error: Object "xy" not found > ?? Error: syntax error > Do you or anyone have any other idea? Thank you G?bor