[R] Bug? in summary( ) function base package
hadley wickham
h.wickham at gmail.com
Wed Apr 30 20:12:51 CEST 2008
On Wed, Apr 30, 2008 at 1:06 PM, Richard Saba <sabaric at auburn.edu> wrote:
> There seems to be an error in the summary() function when applied to "ts"
> class objects. The results of a call to summary( ), on the R "ts" data set
> USAccDeaths , reports the wrong value for Max. The value reported by the
> summary function is 11320. The max( ) function returns the correct value
> 11317, the July 1993 value. Coercing the data to a data.frame and calling
> summary returns the correct max value. A search of R -help found a post in
> 2007 that mentioned a problem but attributed it to rounding errors. But this
> is too large a difference to account for a simple rounding error.
Notice that all the numbers in :
> > summary(USAccDeaths)
> Min. 1st Qu. Median Mean 3rd Qu. Max.
> 6892 8089 8728 8789 9323 11320
have four significant digits and then carefully read the documentation
for the digits argument of summary. That should suggest both the
cause and a solution.
Hadley
--
http://had.co.nz/
More information about the R-help
mailing list