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 upColumns with missing values only in plot_missing() #127
Conversation
…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, ] |
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))
}
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)) | |||
boxuancui
Aug 23, 2019
Owner
This is not necessary.
This is not necessary.
|
If you would like to submit a PR, please complete the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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.