[R] Summary shows wrong maximum

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Dec 6 14:34:02 CET 2006


'Unfortunately' you give no credentials for your ex cathedra 
pronouncement.  E.g.

http://en.wikipedia.org/wiki/Significant_digits

says

The situation regarding trailing zero digits that fall to the left of the 
decimal place in a number with no digits provided that fall to the right 
of the decimal place is less clear, but these are typically not considered 
significant unless the decimal point is placed at the end of the number to 
indicate otherwise (e.g., "2000." versus "2000"). To make things more 
clear, trailing zeros are only recognized as significant figures if the 
number they are a part of has a decimal point. For example, 450 only has 
two sig figs, but 450. has three.

which directly contradicts you.  So this is at best a matter of opinion, 
and credentials do matter for opinions.


On Tue, 5 Dec 2006, Oliver Czoske wrote:

> 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.
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list