Assumes x is numeric, length(x) >= 4, and all values are finite and non-missing.
isDiscrete(
x,
tol = sqrt(.Machine$double.eps),
unique_ratio = 0.2,
max_levels = 10
)
TRUE/FALSE best-guess.
Numeric vector.
Relative tolerance for "integer-like" checks.
Max ratio of unique values to n to still consider discrete (must be < 1).
Max absolute number of unique values to still consider discrete.
Uses integer-within-tolerance and low unique-to-n with repetition (via unique ratio).