#RStats #Rprogramming Does anyone know why the below comparisons fail to return TRUE in R?
x = seq(from = 0, to = 1, by = 0.05)
# the following seem to fail (at least in R 4.2.1)
x[4] == 0.15
x[7] == 0.30
identical(x[4], 0.15)
# but this one works
all.equal(x[4], 0.15)
4
2
2
That would another (somewhat compliated by extra structure overlayed) entry for R FAQ 7.31
cran.r-project.org/doc/FAQ/R…
Nov 12, 2022 · 5:11 AM UTC
1
4

