I am at my wits end. I am shocked that I am getting this problem in R that I am unable to fix for last 3 hours. Please help
df$time
[1] 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10
[12] 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21
[23] 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32
[34] 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43
[45]
Now I do
which(df$time == 0.35)
integer(0) # Why do I get this null here, it should be 36
But when I do
which(df$time == 0.33)
[1] 34
or
which(df$time == 0.36)
[1] 37
or
which(df$time == 0.34)
[1] 35
What is the problem with 0.35?
EDIT:
options()[c("scipen","digits")]
$scipen
[1] 0
$digits
[1] 7
and
class(df$time)
[1] "numeric"
which(as.numeric(df$time) == 0.35)
integer(0)
EDIT : Requested output
dput(df$time[1:40])
c(0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1,
0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21,
0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.3, 0.31, 0.32,
0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39)