Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in printing percentage NA - close #62 #70

Merged
merged 1 commit into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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