Skip to contents

These value predicates are designed to identify common values that appear in numeric vectors.

Usage

is_positive(x)

is_negative(x)

is_whole_number(x, tol = .Machine$double.eps)

is_scalar_whole_number(x, tol = .Machine$double.eps)

Arguments

x

vector to be tested

tol

value specifiying precision desired (see .Machine or double for more info)

Details

is_whole_number() should generally be used when a whole number is desired (whether integer or double) instead of base::is.integer or the rlang::is_integer family because those test the data type no the value.

See also