Skip to content

Commit

Permalink
fix bug in printing percentage NA - close #62
Browse files Browse the repository at this point in the history
  • Loading branch information
njtierney committed Mar 20, 2018
1 parent e710f2d commit 68bddab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: visdat
Title: Preliminary Visualisation of Data
Version: 0.2.2.9100
Version: 0.2.2.9200
Authors@R: c(
person("Nicholas", "Tierney", role = c("aut", "cre"),
email = "nicholas.tierney@gmail.com",
comment = c(ORCID = "https://orcid.org/0000-0003-1460-8722")),
person("Sean", "Hughes", role = "rev"),
person("Sean", "Hughes", role = "rev",
comment =c(ORCID = "https://orcid.org/0000-0002-9409-9405",
"Sean Hughes reviewed the package for rOpenSci,
see https://github.com/ropensci/onboarding/issues/87")),
Expand Down
7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# visdat 0.2.2.9100 (2018/03/20)
# visdat 0.2.2.9200 (2018/03/20)

* fix visdat x axis lineup - [issue 57](https://github.com/ropensci/visdat/issues/57)
## Bugfixes

* fix visdat x axis alignment - [issue 57](https://github.com/ropensci/visdat/issues/57)
* fix bug where the column percentage missing would print to be NA when it was exactly equal to 0.1% missing. - [issue 62](https://github.com/ropensci/visdat/issues/62)

# visdat 0.2.2.9000 (2018/02/20)

Expand Down
4 changes: 2 additions & 2 deletions R/internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ label_col_missing_pct <- function(x,
col_order_index){

# present everything in the right order
purrr::map_df(x, ~round(mean(is.na(.))*100,1))[col_order_index] %>%
purrr::map_df(x, ~round(mean(is.na(.))*100,2))[col_order_index] %>%
purrr::map_chr(function(x){
dplyr::case_when(
x == 0 ~ "0%",
x > 0.1 ~ paste0(x,"%"),
x >= 0.1 ~ paste0(x,"%"),
x < 0.1 ~ "<0.1%"
)
}) %>%
Expand Down

0 comments on commit 68bddab

Please sign in to comment.