[R] - round() strange behaviour

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu Aug 2 22:38:49 CEST 2007


On Thu, 2 Aug 2007, Monica Pisica wrote:

>
> Hi,
>
> 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)[1] 2> round(2.5)[1] 2
> While i would expect that round(2.5) be 3 and not 2.
>
> Do you have any explanation for that?

Yes: you obviously did not read the man page! Please do.
Z

> I really appreciate your input,
>
> Monica
>
>
> _________________________________________________________________
> [[trailing spam removed]]
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> 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.
>
>



More information about the R-help mailing list