I would like to know the position of where the first number in a decimal place is less than 5. If this is not possible (where all numbers are 5 or over) then however many decimal places the number has should be returned instead.
So this data:
library(dplyr)
Data <- tibble(Number = c(0.998971282, 0.97871, 0.98121752874, 0.98921752874, 0.95171358,0.99999999))
Should produce an output like this:
Data %>% mutate(Position = c(6, 5, 3, 4, 3, 8))