Build a bit flag by counting the number of decimals

bf_decimals(x, test, sep = "\\.", fill = TRUE)

Arguments

x

data.frame(1)
the table that contains test.

test

character(1)
the column in x for which decimals are checked.

sep

character(1)
regex-compatible symbol that separates the decimals from the numeric value.

fill

logical(1)
whether the function should consider decimals lengths from 0 through the maximum length in x[[test]], or whether it should only document existing decimal lengths.

Details

The show method of various classes shows decimals that may not really be present, and that even includes ordinary numeric vectors. In these cases, what is printed in the R console may be misleading. Doublecheck with str.

Determine the number of decimals of coordinates to determine their precision: https://en.wikipedia.org/wiki/Decimal_degrees