I am working in R. I have a series of coordinates in decimal degrees, and I would like to sort these coordinates by how many decimal places these numbers have (i.e. I will w
Another contribution, keeping fully as numeric representations without converting to character:
countdecimals <- function(x) { n <- 0 while (!isTRUE(all.equal(floor(x),x)) & n <= 1e6) { x <- x*10; n <- n+1 } return (n) }