What if I want to use inequality? For example, `90.8 - 90.6 <= 0.2`, which will give `FALSE`
– ArthurOct 05 '17 at 14:05
1
`is.less <- function(x, y, tol = .Machine$double.eps^0.5) x - y < tol; is.less(90.8 - 90.6, 0.2)` returns `TRUE`. Same for `<=` or `>`. If you want equality use `abs(x - y) < tol`.
– Rui BarradasOct 05 '17 at 14:11
@rawr That's the standard way but the reason why the function in my comment is that `all.equal` is not vectorized and sometimes we need a logical vector. Note that I use the same default tolerance as `all.equal`.
– Rui BarradasOct 05 '17 at 17:37