Skip to contents

This function checks if a numeric value is and integer-like scalar, meaning it is numeric and its length is 1.

Usage

is_integerlike(x)

Arguments

x

Numeric value to check.

Value

TRUE if x is integer-like, otherwise FALSE.

Examples

is_integerlike(3) # TRUE
#> [1] TRUE
is_integerlike(3.5) # FALSE
#> [1] FALSE
is_integerlike("3") # FALSE
#> [1] FALSE
is_integerlike(c(1, 2)) # FALSE
#> [1] FALSE