[R] numerical accuracy, dumb question
MSchwartz at MedAnalytics.com
Sat Aug 14 04:41:53 CEST 2004
Part of that decision may depend upon how big the dataset is and what is
intended to be done with the ID's:
They will by default, as Andy indicates, be read and stored as doubles.
They are too large for integers, at least on my system:
Converting to a character might make sense, with only a minimal memory
penalty. However, using a factor results in a notable memory penalty, if
the attributes of a factor are not needed.
If any mathematical operations are to be performed with the ID's then
leaving them as doubles makes most sense.
Dan, more information on the numerical characteristics of your system
can be found by using:
See ?.Machine and ?object.size for more information.
On Fri, 2004-08-13 at 21:02, Liaw, Andy wrote:
> If I'm not mistaken, numerics are read in as doubles, so that shouldn't be a
> problem. However, I'd try using factor or character.
> > From: Dan Bolser
> > I store an id as a big number, could this be a problem?
> > Should I convert to at string when I use read.table(...
> > example id's
> > 1001001001001
> > 1001001001002
> > ...
> > 1002001002005
> > Bigest is probably
> > 1011001001001
> > Ta,
> > Dan.
More information about the R-help