EqualsEquals: For testing equivalence of numbers.

Description Usage Arguments Details Value Note Author(s) Examples

Description

Operator that is similar to ==, for comparing two numeric vectors.

Usage

1
a %==% b

Arguments

a

numeric vector to be tested for equivalence.

b

numeric vector to be tested against a for equivalence.

Details

This operator works with the option insigbits, which should be an integer between 1 and 8. The option insigbits defines how many bits (from least significant) will be considered as insignificant in deciding upon equality.

Value

TRUE if all but the insignificant parts are identical.

Note

Default for insigbits is 6, it can be changed by using

options(insigbits = #),

where # is the desired value.

Author(s)

Aaron Hayman

Examples

1
2
3
4
5
a = 90
b = 100*(0.95 - 0.05)  # 90
a == b  # FALSE
a - b  # 1.421085e-14
a %==% b  # TRUE

jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.