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

NOEL Yvonnick yvonnick.noel at uhb.fr
Wed Jan 24 17:29:14 CET 2007


Hello,

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

 > options("OutDec")
$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
France


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



More information about the R-help mailing list