[R] <= returns wrong result? Why

Liviu Andronic landronimirc at gmail.com
Wed Jan 13 08:37:56 CET 2010


On 1/13/10, Trafim Vanishek <rdapamoga at gmail.com> wrote:
>  this is the output result
>  > Rk[47] <= RB[21]
>  [1] FALSE
>
>  > Rk[47]
>  [1] 0.002842007
>
>  > RB[21]
>  [1] 0.002842007
>
I would suspect that, if you're looking at all the digits, the two are
not exactly the same. I would try
round(Rk[47], 10) <= round(RB[21], 10)

Liviu



More information about the R-help mailing list