[R] - round() strange behaviour
loesljrg at verizon.net
Thu Aug 2 23:29:10 CEST 2007
On 2 Aug 2007 at 20:16, Monica Pisica wrote:
> I am getting some strange results using round - it seems that it depends if the number before the decimal point is odd or even ....
> For example:
> > round(1.5) 2> round(2.5) 2
> While i would expect that round(2.5) be 3 and not 2.
> Do you have any explanation for that?
I wouldn't call that strange behaviour; I'd call that correct.
> I really appreciate your input,
> [[trailing spam removed]]
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
John R. Gleason
430 Huntington Hall Voice: 315-443-3107
Syracuse, NY 13244-2340 USA FAX: 315-443-4085
PGP public key at keyservers
More information about the R-help