all_equal: Test a vector (numeric or otherwise) for equivalency across...

View source: R/all_equal.R

all_equalR Documentation

Test a vector (numeric or otherwise) for equivalency across all elements

Description

Test a vector (numeric or otherwise) for equivalency across all elements. For numeric values, a tolerance is used to test equivalency. For non-numeric values, unique is used to determine equivalency.

Usage

all_equal(x, tol = .Machine$double.eps ^ 0.5)

Arguments

x

vector to test for equivalency

tol

numeric, the tolerance to use for equivalency of numeric objects. Ignored if x is not numeric. Defaults to the square-root of the machine precision, typically about 1.5e-8.

Value

logical, either TRUE (all elements are equivalent) or FALSE (some elements are not equivalent)


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.