[R] Max vs summary inconsistency

François Pinard pinard at iro.umontreal.ca
Mon Aug 27 20:46:25 CEST 2007


[Adam D. I. Kramer]

>I'm having the following questionable behavior:

>> summary(m)
>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
>       1   13000   26280   25890   38550   50910 
>> max(m)
>[1] 50912

>...it seems to me like max() and summary(m)[6] ought to return the same
>number.  Am I doing something wrong?

Some may say that you did not scrutinize the documentation enough, as 
"summary" artificially limits the number of significant digits.

However, this question reoccurs often and regularly in these mailing 
lists, so at last, maybe something should be done about it, beyond 
documenting how it works.  Overall, too many users got mislead, that one 
may not so bluntly assert they are all wrong.

For example, resorting to scientific notation whenever non significant 
zero digits would have otherwise been printed.  This should clarify 
a bit that the printing precision got artificially limited.

-- 
François Pinard   http://pinard.progiciels-bpi.ca



More information about the R-help mailing list