[R] Summary shows wrong maximum

Oliver Czoske czoske at astro.rug.nl
Tue Dec 5 15:07:32 CET 2006


On Mon, 4 Dec 2006, Uwe Ligges wrote:
> Sebastian Spaeth wrote:
> > Hi all,
> > I have a list with a numerical column "cum_hardreuses". By coincidence I  
> > discovered this:
> > 
> >> max(libs[,"cum_hardreuses"])
> > [1] 1793
> > 
> >> summary(libs[,"cum_hardreuses"])
> >     Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
> >        1       2       4      36      14    1790
> > 
> > (note the max value of 1790) Ouch this is bad! Anything I can do to remedy  
> > this? Known bug?
> 
> No, it's a feature! See ?summary: printing is done up to 3 significant 
> digits by default. 

Unfortunately, '1790' is printed with *four* significant digits, not 
three. The correct representation with three significant digits would have 
to employ scientific notation, 1.79e3. 

-- 
--------------------------------------------------------------
Oliver Czoske                              czoske at astro.rug.nl
Kapteyn Astronomical Institute           Tel.: +31-50-363 4036
P.O.Box 800
9700 AV Groningen
Netherlands




More information about the R-help mailing list