outer_allequal: Test if Two double Vectors are Element-Wise (Nearly) Equal

View source: R/allequal.R

outer_allequalR Documentation

Test if Two double Vectors are Element-Wise (Nearly) Equal

Description

Test if two double vectors are element-wise (nearly) equal.

Usage

outer_allequal(target, current, tolerance = sqrt(.Machine$double.eps), ...)

Arguments

target

length-n_t double vector, the target value(s), missing value not allowed

current

length-n_c double vector, the value(s) to be compared with target, missing value not allowed

tolerance

positive double scalar, default sqrt(.Machine$double.eps)

...

potential parameters, currently not in use

Details

Function outer_allequal is different from all.equal.numeric, such that

  • only compares between double, not complex, values

  • element-wise comparison is performed

  • a logical scalar is always returned for each element-wise comparison.

Value

Function outer_allequal returns an n_c\times n_t logical matrix indicating whether the length-n_c vector current is element-wise near-equal to the length-n_t vector target within the pre-specified tolerance.

See Also

outer

Examples

x = c(.3, 1-.7, 0, .Machine$double.eps)
outer_allequal(current = x, target = c(.3, 0))


QuantileGH documentation built on May 29, 2024, 12:14 p.m.