[R] difference between max in summary table and max function

Martyn Byng martyn.byng at nag.co.uk
Fri Feb 13 12:14:38 CET 2015


Its a formatting thing, try

summary(testrow,digits=20)

-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Franckx Laurent
Sent: 13 February 2015 11:00
To: r-help at r-project.org
Subject: [R] difference between max in summary table and max function

Dear all

I have found out that the max in the summary of an integer vector is not always equal to the actual maximum of that vector. For example:


> testrow <- c(1:131509)
> summary(testrow)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
      1   32880   65760   65760   98630  131500
> max(testrow)
[1] 131509

This has occurred both in a Windows and in a Linux environment.

Does this mean that the max value in the summary is only an approximation?

Best regards

Laurent Franckx, PhD
Senior researcher sustainable mobility
VITO NV | Boeretang 200 | 2400 Mol
Tel. ++ 32 14 33 58 22| mob. +32 479 25 59 07 | Skype: laurent.franckx | laurent.franckx at vito.be | Twitter @LaurentFranckx




VITO Disclaimer: http://www.vito.be/e-maildisclaimer

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

________________________________________________________________________
This e-mail has been scanned for all viruses by Star.\ _...{{dropped:3}}



More information about the R-help mailing list