close_enough: Check whether two numeric vectors are close enough

View source: R/utils.R

close_enoughR Documentation

Check whether two numeric vectors are close enough

Description

This is like dplyr::near() except with much less precision.

Usage

close_enough(x, y, tol = 10^-3)

Arguments

x

a numeric vector

y

another numeric vector

tol

tolerance (default: 10^-3.)

Value

TRUE if all numbers are near enough within the tolerance, otherwise FALSE

Author(s)

Kelly Sovacool sovacool@umich.edu

Examples


close_enough(0.0004, 0)
close_enough(0.8887, 0.8884)
close_enough(1, 2)

SchlossLab/mothuR documentation built on Aug. 29, 2023, 1:32 a.m.