I am not sure, whether ever round_digit() in R/utilities.R will ever be called with a negative number.
But just wanted to point out that
the while loop in
round_digit <- function (d) {
i <- 0
while (d < 1) {
d <- d * 10
i <- i + 1
}
round(d)/10^i
}
ends up in an infinitive loop if d <= 0 which is I think not desired.
I am not sure, whether ever
round_digit()
inR/utilities.R
will ever be called with a negative number. But just wanted to point out that thewhile
loop inends up in an infinitive loop if
d <= 0
which is I think not desired.