#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…
1
4
It is a rite of passage. Program sufficiently much with #rstats and you will most likely fall into an 'R FAQ 7.31'-shaped hole. Holds with other programming languages too, unless you operate symbolically.
Nov 12, 2022 · 4:14 PM UTC
1
1
4


