Check if a number is an integer
is_integer.RdCheck if a number is an integer
Value
A logical vector the same length as X with TRUE for integers, FALSE for non-numeric integers, and either FALSE or NA for non-numeric values.
Examples
x1 <- c(1,2.1,"a")
is_integer(x1, non_numbers_as_na = TRUE)
#> Warning: NAs introduced by coercion
#> [1] TRUE FALSE NA
is_integer(x1, non_numbers_as_na = FALSE)
#> Warning: NAs introduced by coercion
#> [1] TRUE FALSE FALSE