Learn R Programming

arkhe (version 0.2.2)

predicate-numeric: Numeric Predicates

Description

Check numeric objects:

Usage

is_odd(x)

is_even(x)

is_positive(x, strict = FALSE)

is_whole(x, tolerance = .Machine$double.eps^0.5)

is_binary(x)

Arguments

x

A numeric object to be tested.

strict

A logical scalar: should missing values (including NaN) be omitted?

tolerance

A numeric scalar giving the tolerance to check within.

Value

A logical vector.

Details

is_odd and is_even check if a number is odd or even, respectively.

is_positive checks if an object contains only (strictly) positive numbers.

is_binary checks if an object contains only \(0\)s and \(1\)s.

is_whole checks if an object only contains whole numbers.

See Also

Other predicates: predicate-graph, predicate-matrix, predicate-scalar, predicate-trend, predicate-type, predicate-utils