This is the problem with numerical accuracy and/or with printing. Here is an example of what I mean:
x <- c(0.35, 0.3499999999999999)
x
#> [1] 0.35 0.35
which(x == 0.35)
#> [1] 1
Created on 2018-11-23 by the reprex package (v0.2.1)
As you can see, second number is printed as 0.35, but which can't find it.
In general, when you are dealing with floats, exact comparisons are impossible, so it's better to use something like all.equal that takes into account numerical precision.