check-vector-isIntegerish: Is the input integer(ish)?

check-vector-isIntegerishR Documentation

Is the input integer(ish)?

Description

Check for valid input of either explicit (e.g. 1L) and/or implict (e.g. 1) integer.

Usage

isIntegerish(x, infiniteOk = TRUE, naOk = FALSE)

allAreIntegerish(x)

isInt(x, nullOk = FALSE)

Arguments

x

Object.

infiniteOk

logical(1). Allow infinite values (Inf or -Inf) to pass.

naOk

logical(1). Allow NA values to pass.

nullOk

logical(1). If set to TRUE, x may also be NULL.

Value

TRUE on success; FALSE on failure, with cause set.

Functions

  • isIntegerish(): Vectorized.

  • allAreIntegerish(): Scalar.

  • isInt(): Scalar.

Note

Updated 2023-09-29.

See Also

  • isInt() or isScalarIntegerish() for scalar.

  • rlang::is_integerish().

  • checkmate::checkIntegerish().

Examples

## TRUE ====
isIntegerish(seq_len(2L))
isIntegerish(c(1, 2))
isIntegerish(S4Vectors::Rle(c(1, 2)))

## FALSE ====
isIntegerish(0.1)

steinbaugh/goalie documentation built on Jan. 17, 2024, 5:16 p.m.