Displaying 1 result from an estimated 1 matches for "digit_".
Did you mean:
digit
2005 Feb 22
4
round() - strange results
Hello,
I found that round() does not behave as I expected.
Have you had similar experience as following?
> x<-seq(0.5,10.5,by=1)
> x
[1] 0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5
> round(x)
[1] 0 2 2 4 4 6 6 8 8 10 10
> cbind(x,round(x))
x
[1,] 0.5 0
[2,] 1.5 2
[3,] 2.5 2
[4,] 3.5 4
[5,] 4.5 4
[6,] 5.5 6
[7,] 6.5 6