Hello, 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> typeof(m)[1] "integer"> class(m)[1] "integer" ...it seems to me like max() and summary(m)[6] ought to return the same number. Am I doing something wrong? I'm running R 2.5.1 (2007-06-27), installed on MacOSX from the dmg file found on CRAN. -- Adam D. I. Kramer Ph.D. Student, University of Oregon adik at uoregon.edu
On Mon, 27 Aug 2007, Adam D. I. Kramer wrote:> Hello, > > 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 > >> typeof(m) > [1] "integer" >> class(m) > [1] "integer" > > ...it seems to me like max() and summary(m)[6] ought to return the same > number. Am I doing something wrong? >They do return the same number, they just print it differently. summary() prints four significant digits by default. -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle
[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