Skip to content

read-in, error???

3 messages · Istvan Nemeth, Sarah Goslee, William Dunlap

#
Hi Istvan,

That's most unusual, and quite unlikely (and much larger than the
usual floating-point rounding errors).

Please provide a reproducible example. I assume you got the data from here:
http://www.itl.nist.gov/div898/strd/anova/SmLs07.dat

What did you do with it then? How did you delete the header rows?

What R code did you use to read it in?

What OS and version of R are you working with?

R has been well-validated; it's more likely that you did something
sub-optimal while importing the data.

Sarah
On Fri, May 4, 2012 at 9:54 AM, Istvan Nemeth <furgeurge at gmail.com> wrote:

  
    
#
You didn't mention it, but did you use something like
   options(digits=20)
before displaying that data?  In any case,
  >  1000000000000.4000244 == 1000000000000.4
  [1] TRUE
because R uses the IEEE-754 double precision floating point
arithmetic that all modern computers support.  That gives
you 52 binary digits of precision, somewhat less than 17 decimal
digits, so your difference in the 18th digit is ignored.

If you need more than 16 decimal digits of precision, you
could break the numbers into parts (via string manipulation,
before reading them as numbers) and or use a high precision
package like Rmpfr to manipulate them (it will be slow and  has
limited functionality).

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com