Skip to content

Commit

Permalink
fix: ggparcoord anyClass ordering with missing values in data
Browse files Browse the repository at this point in the history
  • Loading branch information
92amartins committed Apr 25, 2024
1 parent 1f58feb commit 07ad303
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/ggparcoord.R
Expand Up @@ -396,6 +396,7 @@ ggparcoord <- function(
}

data <- data[dataCompleteCases, ]
saveData2 <- saveData2[dataCompleteCases, ]
} else if (tolower(missing) %in% c("mean", "median", "min10", "random")) {
missingFns <- list(
mean = function(x) {
Expand Down
11 changes: 11 additions & 0 deletions tests/testthat/test-ggparcoord.R
Expand Up @@ -227,6 +227,17 @@ test_that("order", {
}
})

test_that("missing and order(anyClass)", {
ds2 <- diamonds.samp
ds2[3, 1] <- NA
missing_options <- c("exclude", "mean", "median", "min10", "random")

for (missing in missing_options) {
p <- ggparcoord(data = ds2, columns = c(1, 5:10), groupColumn = 2, missing = missing, order = "anyClass")
}
expect_true(TRUE)
})

test_that("basic", {
# no color supplied
p <- ggparcoord(data = diamonds.samp, columns = c(1, 5:10))
Expand Down

0 comments on commit 07ad303

Please sign in to comment.