YuLab-SMU / scatterpie

:art: scatter pie plot
https://cran.r-project.org/package=scatterpie
60 stars 16 forks source link

buggy `round_digit()` #19

Closed gwangjinkim closed 5 years ago

gwangjinkim commented 5 years ago

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.

gwangjinkim commented 5 years ago

Pullrequest #20 submitted to fix it.

GuangchuangYu commented 5 years ago

PR merged.