Strange one this. seq()
is creating a mix of numbers and characters, which really screws some things up!
If I create the following sequence:
tmp <- seq(0.1, 2, by=0.1)
Then I get a sequence!
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0
If I try and get individual elements, then some come up as numbers:
tmp[tmp == 0.2]
0.1
But others don't!
tmp[tmp == 0.3]
numeric(0)
If you search for a character, however:
tmp[tmp == "0.3"]
0.3
The same happens for 0.7, 1.2, 1.3, 1.4, 1.5, 1.7, 1.8 and 1.9. I have no idea what is going on. I am running OSX 10.11.2 ('El Capitan') and R 3.2.3. The same thing happens on two colleagues' computers, running Windows (not sure of the version of R).
Any ideas? Thanks!