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

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Wed 24 Jan 2007 - 16:57:01 GMT

>>>>> "NOEL" == NOEL Yvonnick <yvonnick.noel@uhb.fr> >>>>> on Wed, 24 Jan 2007 17:29:14 +0100 writes:

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

>> options("OutDec")

    NOEL> $OutDec
    NOEL> [1] "."
>> as.numeric(".1")

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

>> as.numeric(",1")

    NOEL> [1] 0,1 Oops ! Should not happen, given your getOption("OutDec")

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

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

maybe / probably. We cannot easily reproduce. Instead of the output below, can you please give the full

     sessionInfo()

output?

    NOEL> I would like to use the dot as the decimal separator     NOEL> both for input and output.

Well definitely! (Using "," is crazyness in my eyes!!)

    NOEL> Any suggestion ?

    NOEL> Thank you very much in advance,

    NOEL> Yvonnick Noel
    NOEL> Dprt of Psychology
    NOEL> U. of Rennes
    NOEL> France


    NOEL> platform       i686-pc-linux-gnu
    NOEL> arch           i686
    NOEL> os             linux-gnu
    NOEL> system         i686, linux-gnu
    NOEL> status
    NOEL> major          2
    NOEL> minor          4.0
    NOEL> year           2006
    NOEL> month          10
    NOEL> day            03
    NOEL> svn rev        39566
    NOEL> 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:03 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.