is_whole_number {schematic}R Documentation

Check if a vector has all whole numbers

Description

Similar to 'is_positive_integer()' but without the constraint that the underlying data type is actually integer. Useful if the numbers are stored as 'numeric' but you want to check that they are whole.

Usage

is_whole_number(x)

Arguments

x

A vector

Details

'NA's are ignored.

Value

TRUE if all elements are whole numbers (NA ignored)

Examples

is_whole_number(c(2.0, 4.0)) # TRUE
is_whole_number(c(-1.4)) # FALSE

[Package schematic version 0.1.2 Index]