I would like to compare two vectors elementwise with the all.equal function. Strangely, these two comparisons give different results, and I wonder why it happens.
map2(c(1,1,0.7), c(1,1,0.6), all.equal, tolerance = 0.1, scale = 1)
[[1]]
[1] TRUE
[[2]]
[1] TRUE
[[3]]
[1] TRUE
map2(c(1,1,0.7), c(1,1,0.8), all.equal, tolerance = 0.1, scale = 1)
[[1]]
[1] TRUE
[[2]]
[1] TRUE
[[3]]
[1] "Mean absolute difference: 0.1"
Since the absolute difference between 0.7 and 0.8 and between 0.6 and 0.7 is the same, I expect to get T for both.