Can be helpful as a workaround for gotchas such as: is.numeric(NaN) is.numeric(Inf) is.numeric(NA) is.numeric(NULL)

is_invalid_number(x)

Arguments

x

a vector

Value

boolean

Examples

is_invalid_number(c(NA, Inf, mean(Inf, -Inf)))
#> [1] TRUE TRUE TRUE