R/utils.R
close_enough.Rd
This is like dplyr::near() except with much less precision.
dplyr::near()
close_enough(x, y, tol = 10^-3)
a numeric vector
another numeric vector
tolerance (default: 10^-3.)
10^-3
TRUE if all numbers are near enough within the tolerance, otherwise FALSE
TRUE
FALSE
Kelly Sovacool sovacool@umich.edu
close_enough(0.0004, 0) #> [1] TRUE close_enough(0.8887, 0.8884) #> [1] TRUE close_enough(1, 2) #> [1] FALSE