Skip to content

Commit

Permalink
Update deprecation warnings in ggmatrix_gtable function
Browse files Browse the repository at this point in the history
  • Loading branch information
92amartins committed Apr 24, 2024
1 parent 7e0adb0 commit e9a7f1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions R/ggmatrix_gtable.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#'
#' @param pm \code{\link{ggmatrix}} object to be plotted
#' @param ... ignored
#' @param progress,progress_format Please use the 'progress' parameter in your \code{\link{ggmatrix}}-like function. See \code{\link{ggmatrix_progress}} for a few examples. These parameters will soon be deprecated.
#' @param progress,progress_format `r lifecycle::badge("deprecated")` Please use the 'progress' parameter in your \code{\link{ggmatrix}}-like function. See \code{\link{ggmatrix_progress}} for a few examples.
#' @author Barret Schloerke
#' @importFrom grid gpar grid.layout grid.newpage grid.text grid.rect popViewport pushViewport viewport grid.draw
#' @export
Expand All @@ -25,7 +25,11 @@ ggmatrix_gtable <- function(
hasProgressBar <- !isFALSE(pm$progress)
progress_fn <- pm$progress
} else {
warning("Please use the 'progress' parameter in your ggmatrix-like function call. See ?ggmatrix_progress for a few examples. ggmatrix_gtable 'progress' and 'progress_format' will soon be deprecated.", immediate = TRUE)
lifecycle::deprecate_soft(
when = "2.2.2",
what = I("`progress` and `progress_format`"),
details = "Please use the 'progress' parameter in your ggmatrix-like function call. See ?ggmatrix_progress for a few examples."
)

# has progress variable defined
# overrides pm$progress
Expand Down
2 changes: 1 addition & 1 deletion man/ggmatrix_gtable.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat/test-ggmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ test_that("ggmatrix_gtable progress", {
expect_silent({
pg <- ggmatrix_gtable(pm)
})
expect_warning({
lifecycle::expect_deprecated({
ggmatrix_gtable(pm, progress = TRUE)
})
expect_warning({
lifecycle::expect_deprecated({
ggmatrix_gtable(pm, progress_format = "asdfasdf :plot_i")
})
})
Expand Down

0 comments on commit e9a7f1b

Please sign in to comment.