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

Columns with missing values only in plot_missing() #127

Closed
wants to merge 3 commits into from

Conversation

@AlexLabram
Copy link

@AlexLabram AlexLabram commented Aug 23, 2019

Added option to plot_missing() so that it can ignore variables with no missing values. Very useful for datasets like the Kaggle House Prices contest (81 variables, only 19 of them having missing data), where the chart would otherwise be too cluttered to read.

I'm a complete newbie to both Git and R package development, so there's a very high chance that I've got something wrong here - apologies in advance.

boxuancui and others added 3 commits Mar 27, 2019
…ues.

This remove visual clutter for datasets where only a small proportion of data is missing.
## Declare variable first to pass R CMD check
pct_missing <- Band <- NULL
## Profile missing values
missing_value <- data.table(profile_missing(data))
if (ignore_zeroes)
missing_value <- missing_value[missing_value$num_missing>0, ]

This comment has been minimized.

@boxuancui

boxuancui Aug 23, 2019
Owner

missing_value is a data.table object. You might want to do:

if (missing_only) {
  missing_value <- data.table(profile_missing(data))[num_missing>0]
} else {
  missing_value <- data.table(profile_missing(data))
}
@@ -3,4 +3,7 @@ context("plot missing data profile")
test_that("test return object", {
plot_obj <- plot_missing(airquality)
expect_true(is.ggplot(plot_obj))

plot_obj <- plot_missing(airquality, ignore_zeroes=TRUE)
expect_true(is.ggplot(plot_obj))

This comment has been minimized.

@boxuancui

boxuancui Aug 23, 2019
Owner

This is not necessary.

Copy link
Owner

@boxuancui boxuancui left a comment

If you would like to submit a PR, please complete the roxygen2 documentation as well. Otherwise, I can just push everything to develop later. For now, you can temporarily use the code I provided?

@boxuancui boxuancui self-assigned this Nov 10, 2019
@boxuancui boxuancui added this to the v0.9.0 milestone Nov 10, 2019
@boxuancui boxuancui changed the title Feature suggestion for plot_missing() Columns with missing values only in plot_missing() Nov 11, 2019
boxuancui added a commit that referenced this pull request Nov 11, 2019
@boxuancui boxuancui closed this Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.