From 62e29256072b2a7ea5fce308fec0275a8d0c23a9 Mon Sep 17 00:00:00 2001 From: pepijnvink Date: Thu, 14 Dec 2023 12:26:10 +0100 Subject: [PATCH] Change 'border' parameter to 'grid' --- R/plot_miss.R | 6 +++--- man/plot_miss.Rd | 4 ++-- tests/testthat/{test-plot_miss.R.R => test-plot_miss.R} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename tests/testthat/{test-plot_miss.R.R => test-plot_miss.R} (89%) diff --git a/R/plot_miss.R b/R/plot_miss.R index 86f1e802..46d5f7f1 100644 --- a/R/plot_miss.R +++ b/R/plot_miss.R @@ -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. #' @@ -15,7 +15,7 @@ plot_miss <- function(data, vrb = "all", - border = FALSE, + grid = FALSE, square = FALSE, ordered = FALSE) { # input processing @@ -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() diff --git a/man/plot_miss.Rd b/man/plot_miss.Rd index 7f405f27..98264a8c 100644 --- a/man/plot_miss.Rd +++ b/man/plot_miss.Rd @@ -4,14 +4,14 @@ \alias{plot_miss} \title{Plot missingness in a dataset} \usage{ -plot_miss(data, vrb = "all", border = FALSE, square = FALSE, ordered = FALSE) +plot_miss(data, vrb = "all", grid = FALSE, square = FALSE, ordered = FALSE) } \arguments{ \item{data}{An incomplete dataset of class \code{data.frame} or \code{matrix}.} \item{vrb}{String, vector, or unquoted expression with variable name(s), default is "all".} -\item{border}{Logical indicating whether borders should be present between tiles.} +\item{grid}{Logical indicating whether borders should be present between tiles.} \item{square}{Logical indicating whether the plot tiles should be squares, defaults to squares.} diff --git a/tests/testthat/test-plot_miss.R.R b/tests/testthat/test-plot_miss.R similarity index 89% rename from tests/testthat/test-plot_miss.R.R rename to tests/testthat/test-plot_miss.R index 7c934f2f..8f10f00e 100644 --- a/tests/testthat/test-plot_miss.R.R +++ b/tests/testthat/test-plot_miss.R @@ -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") })