is_integer {riskyr}R Documentation

Test for inters (i.e., whole numbers).

Description

is_integer tests if x contains only integer numbers.

Usage

is_integer(x, tol = .Machine$double.eps^0.5)

Arguments

x

Number(s) to test (required, accepts numeric vectors).

tol

Numeric tolerance value. Default: tol = .Machine$double.eps^0.5 (see ?.Machine for details).

Details

Thus, is_integer does what the base R function is.integer is not designed to do:

See the documentation of is.integer for definition and details.

See Also

is.integer function of the R base package.

Other verification functions: is_complement(), is_extreme_prob_set(), is_freq(), is_matrix(), is_perc(), is_prob(), is_suff_prob_set(), is_valid_prob_pair(), is_valid_prob_set(), is_valid_prob_triple()

Examples

is_integer(2)    # TRUE
is_integer(2/1)  # TRUE
is_integer(2/3)  # FALSE
x <- seq(1, 2, by = 0.5)
is_integer(x)

# Note contrast to base R:
is.integer(2/1)  # FALSE!

# Compare:
is.integer(1 + 2)
is_integer(1 + 2)


[Package riskyr version 0.4.0 Index]