Skip to content

Commit

Permalink
Change 'border' parameter to 'grid'
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijnvink committed Dec 14, 2023
1 parent aa28c98 commit 62e2925
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions R/plot_miss.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param data An incomplete dataset of class `data.frame` or `matrix`.
#' @param vrb String, vector, or unquoted expression with variable name(s), default is "all".
#' @param border Logical indicating whether borders should be present between tiles.
#' @param grid Logical indicating whether borders should be present between tiles.
#' @param ordered Logical indicating whether rows should be ordered according to their pattern.
#' @param square Logical indicating whether the plot tiles should be squares, defaults to squares.
#'
Expand All @@ -15,7 +15,7 @@
plot_miss <-
function(data,
vrb = "all",
border = FALSE,
grid = FALSE,
square = FALSE,
ordered = FALSE) {
# input processing
Expand Down Expand Up @@ -103,7 +103,7 @@ plot_miss <-
) +
theme_minimice()
# additional arguments
if (border) {
if (grid) {
gg <- gg + ggplot2::geom_tile(color = "black")
} else{
gg <- gg + ggplot2::geom_tile()
Expand Down
4 changes: 2 additions & 2 deletions man/plot_miss.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dat <- mice::nhanes
# tests
test_that("plot_miss produces plot", {
expect_s3_class(plot_miss(dat), "ggplot")
expect_s3_class(plot_miss(dat, border = TRUE, ordered = TRUE, square = TRUE), "ggplot")
expect_s3_class(plot_miss(dat, grid = TRUE, ordered = TRUE, square = TRUE), "ggplot")
expect_s3_class(plot_miss(cbind(dat, "testvar" = NA)), "ggplot")
})

Expand Down

0 comments on commit 62e2925

Please sign in to comment.