Hi, I am a newbie of R... What does the following message mean when I tried running a summary() on a dataset? Warning message: Integer overflow in sum(.); use sum(as.numeric(.)) _________________________________________________________________ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley
2002-Mar-29 06:57 UTC
[R] Re: your mail on `Integer overflow in sum(.)'
On Fri, 29 Mar 2002, Chris Wen wrote:> Hi, > > I am a newbie of R... > > What does the following message mean when I tried running a summary() on a > dataset? > > Warning message: > Integer overflow in sum(.); use sum(as.numeric(.))It means that you are taking the mean of some very large integers, and the calculation is overflowing. It is just a warning. This will not happen in the next release of R. Please use a subject when posting to a list. -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 29 Mar 2002, Chris Wen wrote:> Hi, > > I am a newbie of R... > > What does the following message mean when I tried running a summary() on a > dataset? > > Warning message: > Integer overflow in sum(.); use sum(as.numeric(.))It means that when calculating the sum of a set of integer values (as part of calculating the mean) there was a numeric overflow -- the answer was larger than 2^30 or about 1 billion. For large numbers you need to use floating point rather than integer representation. You may want to convert the offending column of your dataset to floating point with eg dataset$variable<-as.numeric(dataset$variable) -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._