[Rd] type.convert and doubles

Martin Maechler maechler at stat.math.ethz.ch
Tue Apr 29 10:41:19 CEST 2014

>>>>>   <Mark.Bravington at csiro.au>
>>>>>     on Tue, 29 Apr 2014 08:25:41 +0000 writes:

    > [...snip...]
    > Martin Maecher wrote:

    >> > I have now committed svn rev 65507  --- to R-devel only for now ---
    >> > the above:   exact = NA  is the default
    >> > and it means  "warning + FALSE".
    >> >
    >> > Interestingly, I currently get 5 identical warnings for one
    >> > simple call, so there seems clearly room for optimization,

BTW, the above was an implicit RFC and for code proposals by
really good C programmers...

    >> >  and that is one main reason for this reason to not yet be migrated
    >> > to 'R 3.1.0 patched'.

    > Peter Dalgaard wrote:
    >> I actually think that the default should be the old behaviour. No warning, just potentially lose digits. If this gets a user in trouble, _then_ turn on the check for lost digits.

    > +1

(yes please, people chime in ... once, you can also give "-1")

    > IMO "read.table" and friends are convenience functions with somewhat of a "do what I mean" flavour, and as such their default should be to work conveniently for most cases. We typically ignore loss of precision in all sorts of numeric operations without warning. Those who do really care about that 21st digit in 'read.table' could always use 'colClasses'. With a 'digitloss' argument (but shouldn't it be column-specific? if not, is it really needed?) 

Note that the current implementation of read.table() and friends
only use type.convert() at all when there are *no* colClasses at
all,  and I think we really should not change that principled
behavior !

>  they can get what they need more easily, but the evidence seems to be that this is a rare case.

    > Mark Bravington
    > CSIRO
    > Hobart
    > Australia

More information about the R-devel mailing list