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.
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. Andy> 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. > > ______________________________________________ > R-help at 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 > >
Dan Bolser <dmb at mrc-dunn.cam.ac.uk> writes:> I store an id as a big number, could this be a problem?If there are ids with significant leading zeros, or too big to be represented accurately (>2^53)--you won't get any warning about it, just silent truncation. So best practice would be to keep them as character strings, using colClasses= in read.table(). -- Brian Gough Network Theory Ltd, Publishing the R Reference Manuals --- http://www.network-theory.co.uk/R/base/