Single/Double precision NA values

David Bateman David.Bateman at motorola.com
Mon Jul 28 03:44:55 CDT 2008


Dear All,

I got no response from the R maintainers to the attached e-mail that I
sent twice to their mailing list. I therefore assume that the R
maintainers don't really care too much about the compatibility of the NA
values between R and Octave, and that Octave must make its own choice
about how to handle this issue.

I previously sent a patch that addressed the issue of Single/Double
precision NA values

http://www.nabble.com/-Changeset--Re%3A-Single-Precision-versus-double-precision-NA-p17679409.html

that replaced the double NA value with one that can be converted from
double to single precision without change, but that is incompatible with
the value from R. The patch also included code such that saved files
that contained the old NA value would have this NA value changed
internally to the new representation.

John's comment on this was "What about always writing values in the old
format when writing binary data, and converting them when reading?".
Sure we can do this, but there are a few caveats

* Linking R and Octave libraries together in a single application
becomes complex as the Octave/R NA representation is different, though
is this really used that much?
* The conversion of the NA values will require either an addition copy
of the array to be written or a slow write function that checks every
value before writing to see if its a NA value.
* Only the Octave/Matlab file formats will be affected by this change,
and so HDF5 file formats for example won't be.
* Files saved with fwrite won't undergo this conversion either

So unless R reads the data from octave using an Octave or Matlab file
format then the NA value won't be preserved in any case. Adding the
conversion of NA values for the HDF5 and fwrite functions as well might
be done, but I'm concerned by the memory usage and speed implications of
this. So should we go this way, or just accept that the R/Octave NA
values are different?

Regards
David

-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

-------------- next part --------------
An embedded message was scrubbed...
From: David Bateman <David.Bateman at motorola.com>
Subject: Re: Issue with NA value and Octave compatibility
Date: Thu, 26 Jun 2008 17:18:07 +0200
Size: 4445
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080728/3c0803db/attachment.mht 


More information about the Octave-maintainers mailing list