DATA_TYPE
the function also checks, if the conversion is perfect, or if something
is lost (e.g., decimal places), or something is strange (like arbitrary
suffixes in a date, just note, that
as.POSIXct("2020-01-01 12:00:00 CET asdf")
does not fail in R
), but
util_conversion_stable("2020-01-01 12:00:00 CET asdf", DATA_TYPES$DATETIME)
will.
util_conversion_stable(vector, data_type, return_percentages = FALSE)
numeric ratio of convertible entries in vector
HINT:
util_conversion_stable(.Machine$integer.max + 1, DATA_TYPES$INTEGER)
seems
to work correctly, although is.integer(.Machine$integer.max + 1)
returns FALSE
.