Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upvis_miss() column %s NA when % = 0.1 #62
Comments
|
Sorry I have overlooked this. This is indeed the case, thank you so much for linking to this line of code, this has made this much easier to debug! OK, so here is pre the change: library(visdat)
library(tibble)
temp <- rnorm(n = 10000,
mean = 25,
sd = 2.5)
temp[1:10] <- NA
wind <- rnorm(n = 10000,
mean = 15,
sd = 7.5)
wind[1:12] <- NA
ozone <- rnorm(n = 10000,
mean = 43,
sd = 30)
ozone[1:8] <- NA
dat <- tibble(temp,
wind,
ozone)
dat
#> # A tibble: 10,000 x 3
#> temp wind ozone
#> <dbl> <dbl> <dbl>
#> 1 NA NA NA
#> 2 NA NA NA
#> 3 NA NA NA
#> 4 NA NA NA
#> 5 NA NA NA
#> 6 NA NA NA
#> 7 NA NA NA
#> 8 NA NA NA
#> 9 NA NA 16.3
#> 10 NA NA 4.26
#> # ... with 9,990 more rows
vis_miss(dat)Created on 2018-03-20 by the reprex package (v0.2.0). This once I made a change to lines 76 and 80 library(visdat)
library(tibble)
temp <- rnorm(n = 10000,
mean = 25,
sd = 2.5)
temp[1:10] <- NA
wind <- rnorm(n = 10000,
mean = 15,
sd = 7.5)
wind[1:12] <- NA
ozone <- rnorm(n = 10000,
mean = 43,
sd = 30)
ozone[1:8] <- NA
dat <- tibble(temp,
wind,
ozone)
dat
#> # A tibble: 10,000 x 3
#> temp wind ozone
#> <dbl> <dbl> <dbl>
#> 1 NA NA NA
#> 2 NA NA NA
#> 3 NA NA NA
#> 4 NA NA NA
#> 5 NA NA NA
#> 6 NA NA NA
#> 7 NA NA NA
#> 8 NA NA NA
#> 9 NA NA 47.1
#> 10 NA NA 17.3
#> # ... with 9,990 more rows
vis_miss(dat)Created on 2018-03-20 by the reprex package (v0.2.0). I think that is it - but please feel free to open this if it doesn't work :) |
fix bug in printing percentage NA - close #62


I have a column with 0.1% missing, and the column percentage is NA instead of 0.1%. I think the issue is that the
case_when()call inlabel_col_missing_pctdoesn't account for the case whenx == 0.1; guessing it should be fixed by changing line 80 to>=instead of>. My attempts at a reprex were failing, but happy to try again or submit a PR if either would help!visdat/R/internals.R
Lines 78 to 82 in de3186b