R-beta: R and LANG

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Jan 8 16:19:28 CET 1998

Goran Brostrom <gb at stat.umu.se> writes:

> I am running R 0.61.0 on a Sparc 5, Solaris 2.4, in tcsh. Today I
> couldn't, to my big surprise, scan a data file in R. As I finally
> understood it, R wanted a decimal comma instead of a decimal point,
> because LANG was set to 'sv'. See my runs below. I wonder why this 

Apparently, the strtod() C library function accepts different formats
depending on locale settings, so probably the setlocale(LC_ALL,""); in
src/main/main.c is doing you in. 

This is the same thing that allows you to have a variable called
"föräldre" and see come out right on plots, etc., so you don't want to
remove that line. 

I think that either you should setenv LC_NUMERIC to C or POSIX or R
should only set LC_CTYPE (and maybe some of the others?).

   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

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list