[R] as.numeric(".1")

From: NOEL Yvonnick <yvonnick.noel_at_uhb.fr>
Date: Wed 24 Jan 2007 - 16:29:14 GMT


I noticed the following strange behavior under R-2.4.0 (Linux Mandriva 2007) :

> options("OutDec")

[1] "."

> as.numeric(".1")

[1] NA
Warning message:
NAs introduits lors de la conversion automatique

> as.numeric(",1")

[1] 0,1

So I need to use the comma as the decimal separator, at least as input. Moreover, the last output also use a comma, though the OutDec option was set to ".". Basic arithmetic ops on the command line work OK with decimal dots.

I am pretty sure as.numeric(".1") used to work under older versions of R. Could it be a localization problem ?

I would like to use the dot as the decimal separator both for input and output. Any suggestion ?

Thank you very much in advance,

Yvonnick Noel
Dprt of Psychology
U. of Rennes

platform       i686-pc-linux-gnu
arch           i686
os             linux-gnu
system         i686, linux-gnu
major          2
minor          4.0
year           2006
month          10
day            03
svn rev        39566
language       R

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 25 16:14:45 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 Jan 2007 - 05:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.