INN: For testing equivalence of numbers contained anywhere within...

Description Usage Arguments Details Value Note Author(s) Examples

Description

Similar to %==% but for testing if numbers in vector a are contained in vector b.

Usage

1
a %INN% 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 for each element of b if all but the insignificant parts are identical to an element in a.

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
6
7
a = c(900,90)
b = c(100*(0.95 - 0.05), 1000*(0.95 - 0.05))  # c(90,900)
a %in% b  # FALSE FALSE
a %==% b  # FALSE FALSE
a[2] - b[1]  # 1.421085e-14
a[1] - b[2]  # 1.136868e-13
a %INN% b  # TRUE TRUE

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