Learn R Programming

arkhe (version 0.3.1)

predicate-numeric: Numeric Predicates

Description

Check numeric objects:

  • is_zero() checks if an object contains only zeros.

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

  • is_positive() and is_negative check if an object contains only (strictly) positive or negative numbers.

  • is_whole() checks if an object only contains whole numbers.

Usage

is_missing(x, finite = FALSE)

is_zero(x, na.rm = FALSE)

is_odd(x, na.rm = FALSE)

is_even(x, na.rm = FALSE)

is_positive(x, strict = FALSE, na.rm = FALSE)

is_negative(x, strict = FALSE, na.rm = FALSE)

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

Arguments

x

A numeric object to be tested.

finite

A logical scalar: should non-finite values also be removed?

na.rm

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

strict

A logical scalar: should strict inequality be used?

tolerance

A numeric scalar giving the tolerance to check within.

Value

A logical vector.

See Also

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