Re: [R] read.table() and precision?

From: Peter Dalgaard <>
Date: Mon, 17 Dec 2007 19:09:57 +0100

Wojciech Gryc wrote:
> Hi,
> I'm currently working with data that has values as large as 99,000,000
> but is accurate to 6 decimal places. Unfortunately, when I load the
> data using read.table(), it rounds everything to the nearest integer.
> Is there any way for me to preserve the information or work with
> arbitrarily large floating point numbers?
> Thank you,
> Wojciech
Are you sure?

To my knowledge, read.table doesn't round anything, except when running out of bits to store the values in, and 13 decimal places should fit in ordinary double precision variables.

Printing the result is another matter. Try playing with the print(mydata, digits=15) and the like.

   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 17 Dec 2007 - 18:15:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Dec 2007 - 19:30:20 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.