[R] storage and single-precision

Mike Miller mbmiller+l at gmail.com
Thu Sep 8 00:25:20 CEST 2011


I'm getting the impression from on-line docs that R cannot work with 
single-precision floating-point numbers, but that it has a pseudo-mode for 
single precision for communication with external programs.

I don't mind that R is using doubles internally, but what about storage? 
If all I need to store is single-precision (32-bit), can I do that?  When 
it is read back into R it can be converted from single to double (back to 
64-bit).

Furthermore, the data are numbers from 0.000 to 2.000 with no missing 
values that could be stored just as accurately as unsigned 16-bit integers 
from 0 to 2000.  That would be the best plan for me.

It looks like the ff package allows for additional formats, so I might try 
to use ff, but I still would like to get a better understanding of R's 
native capabilities in regard to representations of numbers both in RAM 
and in stored data files.

Thanks in advance.

Best,
Mike

--
Michael B. Miller, Ph.D.
Minnesota Center for Twin and Family Research
Department of Psychology
University of Minnesota



More information about the R-help mailing list