Here is the base code and its output. I really can't say anything more than a logical test for a sequence containing 1.2 gives an inaccurate result. It works for many other values.
# Incorrect > seq(0.5, 1.5, by=0.05) == 1.2 [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
I tried to check all the values ββusing the following which does not reproduce the error:
> sapply(seq(0.5, 1.5, by=0.05), function(x){sum(seq(0.5, 1.5, by=0.05) == x)}) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
I am using R version 2.13.2 (2011-09-30), platform: x86_64-pc-linux-gnu (64-bit).
source share