nonbinary-comparison: Non-binary comparison operators

Description Usage Arguments Details Value Examples

Description

These functions provide versions of R's built-in binary comparison operators that work with arbitrarily many arguments. ge is the >= operator, le is <=, eq is ==, lt is <, and gt is >.

Usage

1
2
3
4
5
6
7
8
9

Arguments

...

Values to compare.

Details

If more than 2 arguments are passed, the result is the logical conjunction of the binary operator's return value for each pair of arguments (in order). For example, le(1,2,3) is equivalent to 1 <= 2 <= 3 (mathematically speaking; the second of those is not a valid R expression). In R, le(1,2,3) is equivalent to 1 <= 2 && 2 <= 3, and so on for more arguments.

Value

The boolean result of the comparison.

Examples

1
2
3
4
5
6
7
le(1,2,3) == TRUE

ge(1,2,3) == FALSE

eq(1,1,1) == TRUE

eq(1,2,3) == FALSE

wwbrannon/schemeR documentation built on May 4, 2019, 12:03 p.m.