I've got a strange result for my modulo query here. Maybe somebody has a solution for it:
d <- seq(0.0,1.0,0.1)
lab.y <- ifelse(((d*10) %% 2.0 == 0.0),d, NA)
will give the result:
[1] 0.0 NA 0.2 NA 0.4 NA NA NA 0.8 NA 1.0
so the 0.6
is missing.
I tried to add a query like:
ifelse((d*10/2 == 3.0), d, NA)
which is all FALSE
even though
d*10/2
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
... I don't really understand what's going on here.
Thanks a lot in advance!