diff --git a/NEWS.md b/NEWS.md index 12445271..5b5b511b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # GGally (development version) +* Use lifecycle for deprecation warnings (#494, #496) + # GGally 2.2.1 * Fix compatibility with ggplot2 3.5.0 (@teunbrand, #481) diff --git a/R/deprecated.R b/R/deprecated.R index c81a507b..85a3163c 100644 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -1,16 +1,48 @@ #' Modify a \code{\link{ggmatrix}} object by adding an \pkg{ggplot2} object to all +#' @description +#' `r lifecycle::badge("deprecated")` #' -# \lifecycle{deprecated} +#' This function allows cleaner axis labels for your plots, but is deprecated. +#' You can achieve the same effect by specifying strip's background and placement +#' properties (see Examples). +#' +#' @keywords internal #' #' @export #' @examples #' # Small function to display plots only if it's interactive #' p_ <- GGally::print_if_interactive #' +#' # Cleaner axis labels with v1_ggmatrix_theme #' p_(ggpairs(iris, 1:2) + v1_ggmatrix_theme()) -#' # move the column names to the left and bottom +#' +#' # Move the column names to the left and bottom #' p_(ggpairs(iris, 1:2, switch = "both") + v1_ggmatrix_theme()) +#' +#' # Manually specifying axis labels properties +#' p_( +#' ggpairs(iris, 1:2) + +#' theme( +#' strip.background = element_rect(fill = "white"), +#' strip.placement = "outside" +#' ) +#') +#' +#' # This way you have even more control over how the final plot looks. +#' # For example, if you want to set the background color to yellow: +#' p_( +#' ggpairs(iris, 1:2) + +#' theme( +#' strip.background = element_rect(fill = "yellow"), +#' strip.placement = "outside" +#' ) +#') v1_ggmatrix_theme <- function() { + lifecycle::deprecate_soft( + when = "2.2.2", + what = "v1_ggmatrix_theme()", + details = "This function will be removed in future releases." + ) theme( strip.background = element_rect(fill = "white"), strip.placement = "outside" @@ -20,12 +52,15 @@ v1_ggmatrix_theme <- function() { #' Correlation value plot #' -# \lifecycle{deprecated} -#' -#' (Deprecated. See \code{\link{ggally_cor}}.) +#' @description +#' `r lifecycle::badge("deprecated")` #' #' Estimate correlation from the given data. #' +#' This function is deprecated and will be removed in future releases. +#' +#' See \code{\link{ggally_cor}}. +#' #' @param data data set using #' @param mapping aesthetics being used #' @param alignPercent right align position of numbers. Default is 60 percent across the horizontal @@ -40,7 +75,7 @@ v1_ggmatrix_theme <- function() { #' @importFrom stats complete.cases cor #' @seealso \code{\link{ggally_cor}} #' @export -#' @keywords hplot +#' @keywords internal #' @examples #' # Small function to display plots only if it's interactive #' p_ <- GGally::print_if_interactive @@ -77,6 +112,11 @@ ggally_cor_v1_5 <- function( corAlignPercent = NULL, corMethod = NULL, corUse = NULL, displayGrid = TRUE, ...) { + lifecycle::deprecate_soft( + when = "2.2.2", + what = "ggally_cor_v1_5()", + with = "ggally_cor()" + ) if (!is.null(corAlignPercent)) { stop("'corAlignPercent' is deprecated. Please use argument 'alignPercent'") } diff --git a/R/gg-plots.R b/R/gg-plots.R index 588722f2..1cbbcab9 100644 --- a/R/gg-plots.R +++ b/R/gg-plots.R @@ -261,10 +261,11 @@ ggally_density <- function(data, mapping, ...) { #' @param group_args arguments being supplied to the split-by-color group's \code{\link[ggplot2]{geom_text}()} #' @param justify_labels \code{justify} argument supplied when \code{\link[base]{format}}ting the labels #' @param align_percent relative align position of the text. When \code{justify_labels = 0.5}, this should not be needed to be set. -#' @param alignPercent,displayGrid deprecated. Please use their snake-case counterparts. +#' @param alignPercent,displayGrid `r lifecycle::badge("deprecated")`. Please use their snake-case counterparts. #' @param title title text to be displayed #' @author Barret Schloerke #' @importFrom stats complete.cases cor +#' @importFrom lifecycle deprecated #' @seealso \code{\link{ggally_statistic}}, \code{\link{ggally_cor_v1_5}} #' @export #' @keywords hplot @@ -308,14 +309,22 @@ ggally_cor <- function( justify_labels = "right", align_percent = 0.5, title = "Corr", - alignPercent = warning("deprecated. Use `align_percent`"), - displayGrid = warning("deprecated. Use `display_grid`")) { - if (!missing(alignPercent)) { - warning("`alignPercent` is deprecated. Please use `align_percent` if alignment still needs to be adjusted") + alignPercent = deprecated(), + displayGrid = deprecated()) { + if (lifecycle::is_present(alignPercent)) { + lifecycle::deprecate_soft( + when = "2.2.2", + what = "ggally_cor(alignPercent)", + details = "Please use `align_percent` if alignment still needs to be adjusted." + ) align_percent <- alignPercent } - if (!missing(displayGrid)) { - warning("`displayGrid` is deprecated. Please use `display_grid`") + if (lifecycle::is_present(displayGrid)) { + lifecycle::deprecate_soft( + when = "2.2.2", + what = "ggally_cor(displayGrid)", + details = "Please use `display_grid`" + ) display_grid <- displayGrid } diff --git a/R/ggmatrix_gtable.R b/R/ggmatrix_gtable.R index c63631a2..372e6591 100644 --- a/R/ggmatrix_gtable.R +++ b/R/ggmatrix_gtable.R @@ -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 @@ -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 diff --git a/R/ggnet.R b/R/ggnet.R index a453a1b7..2136848e 100644 --- a/R/ggnet.R +++ b/R/ggnet.R @@ -4,6 +4,9 @@ if (getRversion() >= "2.15.1") { #' Network plot #' +#' @description +#' `r lifecycle::badge("deprecated")` +#' #' Function for plotting network objects using \pkg{ggplot2}, now replaced by the #' \code{\link{ggnet2}} function, which provides additional control over #' plotting parameters. Please visit \url{https://github.com/briatte/ggnet} for @@ -114,12 +117,12 @@ if (getRversion() >= "2.15.1") { #' @param legend.position the location of the plot legend(s). Accepts all #' \code{legend.position} values supported by \code{\link[ggplot2]{theme}}. #' Defaults to \code{"right"}. -#' @param names deprecated: see \code{group.legend} and \code{size.legend} -#' @param quantize.weights deprecated: see \code{weight.cut} -#' @param subset.threshold deprecated: see \code{weight.min} -#' @param top8.nodes deprecated: this functionality was experimental and has +#' @param names `r lifecycle::badge("deprecated")` see \code{group.legend} and \code{size.legend} +#' @param quantize.weights `r lifecycle::badge("deprecated")` see \code{weight.cut} +#' @param subset.threshold `r lifecycle::badge("deprecated")` see \code{weight.min} +#' @param top8.nodes `r lifecycle::badge("deprecated")` this functionality was experimental and has #' been removed entirely from \code{ggnet} -#' @param trim.labels deprecated: see \code{label.trim} +#' @param trim.labels `r lifecycle::badge("deprecated")` see \code{label.trim} #' @param ... other arguments passed to the \code{geom_text} object that sets #' the node labels: see \code{\link[ggplot2]{geom_text}} for details. #' @seealso \code{\link{ggnet2}} in this package, @@ -135,6 +138,7 @@ if (getRversion() >= "2.15.1") { #' @importFrom stats quantile na.omit #' @importFrom utils head installed.packages #' @importFrom grDevices gray.colors +#' @keywords internal #' @examples #' # Small function to display plots only if it's interactive #' p_ <- GGally::print_if_interactive @@ -199,13 +203,14 @@ ggnet <- function( legend.size = 9, legend.position = "right", # -- deprecated arguments ---------------------------------------------------- - names = c("", ""), - quantize.weights = FALSE, - subset.threshold = 0, - top8.nodes = FALSE, - trim.labels = FALSE, + names = deprecated(), + quantize.weights = deprecated(), + subset.threshold = deprecated(), + top8.nodes = deprecated(), + trim.labels = deprecated(), ... ) { + lifecycle::deprecate_soft("2.2.2", "ggnet()", "ggnet2()") # -- packages ---------------------------------------------------------------- @@ -213,32 +218,55 @@ ggnet <- function( # -- deprecations ------------------------------------------------------------ if (length(mode) == 1 && mode == "geo") { - warning("mode = 'geo' is deprecated; please use mode = c('lon', 'lat') instead") + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggnet(mode='cannot be `geo`')", + details = "Please use mode = c('lon', 'lat') instead" + ) mode = c("lon", "lat") } - if (!identical(names, c("", ""))) { - warning("names is deprecated; please use group.legend and size.legend instead") + if (lifecycle::is_present(names)) { + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggnet(names)", + details = "Please use group.legend and size.legend instead" + ) group.legend = names[1] size.legend = names[2] } - if (isTRUE(quantize.weights)) { - warning("quantize.weights is deprecated; please use weight.cut instead") - weight.cut = TRUE + if (lifecycle::is_present(quantize.weights)) { + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggnet(quantize.weights)", + details = "Please use weight.cut instead" + ) + weight.cut = quantize.weights } - if (subset.threshold > 0) { - warning("subset.threshold is deprecated; please use weight.min instead") + if (lifecycle::is_present(subset.threshold)) { + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggnet(subset.threshold)", + details = "Please use weight.min instead" + ) weight.min = subset.threshold } - if (isTRUE(top8.nodes)) { - warning("top8.nodes is deprecated") + if (lifecycle::is_present(top8.nodes)) { + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggnet(top8.nodes)" + ) } - if (isTRUE(trim.labels)) { - warning("trim.labels is deprecated; please use label.trim instead") + if (lifecycle::is_present(trim.labels)) { + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggnet(trim.labels)", + details = "Please use label.trim instead" + ) label.trim = function(x) gsub("^@|^http://(www\\.)?|/$", "", x) } diff --git a/man/ggally_cor.Rd b/man/ggally_cor.Rd index 13a33a78..cc361f86 100644 --- a/man/ggally_cor.Rd +++ b/man/ggally_cor.Rd @@ -18,8 +18,8 @@ ggally_cor( justify_labels = "right", align_percent = 0.5, title = "Corr", - alignPercent = warning("deprecated. Use `align_percent`"), - displayGrid = warning("deprecated. Use `display_grid`") + alignPercent = deprecated(), + displayGrid = deprecated() ) } \arguments{ @@ -55,7 +55,7 @@ ggally_cor( \item{title}{title text to be displayed} -\item{alignPercent, displayGrid}{deprecated. Please use their snake-case counterparts.} +\item{alignPercent, displayGrid}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}. Please use their snake-case counterparts.} } \description{ Estimate correlation from the given data. If a color variable is supplied, the correlation will also be calculated per group. diff --git a/man/ggally_cor_v1_5.Rd b/man/ggally_cor_v1_5.Rd index 1b313049..1159e362 100644 --- a/man/ggally_cor_v1_5.Rd +++ b/man/ggally_cor_v1_5.Rd @@ -39,10 +39,13 @@ ggally_cor_v1_5( \item{...}{other arguments being supplied to geom_text} } \description{ -(Deprecated. See \code{\link{ggally_cor}}.) -} -\details{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + Estimate correlation from the given data. + +This function is deprecated and will be removed in future releases. + +See \code{\link{ggally_cor}}. } \examples{ # Small function to display plots only if it's interactive @@ -79,4 +82,4 @@ p_(ggally_cor_v1_5( \author{ Barret Schloerke } -\keyword{hplot} +\keyword{internal} diff --git a/man/ggmatrix_gtable.Rd b/man/ggmatrix_gtable.Rd index 5a474d11..8bed9c56 100644 --- a/man/ggmatrix_gtable.Rd +++ b/man/ggmatrix_gtable.Rd @@ -16,7 +16,7 @@ ggmatrix_gtable( \item{...}{ignored} -\item{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.} +\item{progress, progress_format}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Please use the 'progress' parameter in your \code{\link{ggmatrix}}-like function. See \code{\link{ggmatrix_progress}} for a few examples.} } \description{ Specialized method to print the \code{\link{ggmatrix}} object. diff --git a/man/ggnet.Rd b/man/ggnet.Rd index e371d906..7d5174b6 100644 --- a/man/ggnet.Rd +++ b/man/ggnet.Rd @@ -35,11 +35,11 @@ ggnet( label.trim = FALSE, legend.size = 9, legend.position = "right", - names = c("", ""), - quantize.weights = FALSE, - subset.threshold = 0, - top8.nodes = FALSE, - trim.labels = FALSE, + names = deprecated(), + quantize.weights = deprecated(), + subset.threshold = deprecated(), + top8.nodes = deprecated(), + trim.labels = deprecated(), ... ) } @@ -177,21 +177,23 @@ Defaults to \code{9}.} \code{legend.position} values supported by \code{\link[ggplot2]{theme}}. Defaults to \code{"right"}.} -\item{names}{deprecated: see \code{group.legend} and \code{size.legend}} +\item{names}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} see \code{group.legend} and \code{size.legend}} -\item{quantize.weights}{deprecated: see \code{weight.cut}} +\item{quantize.weights}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} see \code{weight.cut}} -\item{subset.threshold}{deprecated: see \code{weight.min}} +\item{subset.threshold}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} see \code{weight.min}} -\item{top8.nodes}{deprecated: this functionality was experimental and has +\item{top8.nodes}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} this functionality was experimental and has been removed entirely from \code{ggnet}} -\item{trim.labels}{deprecated: see \code{label.trim}} +\item{trim.labels}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} see \code{label.trim}} \item{...}{other arguments passed to the \code{geom_text} object that sets the node labels: see \code{\link[ggplot2]{geom_text}} for details.} } \description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + Function for plotting network objects using \pkg{ggplot2}, now replaced by the \code{\link{ggnet2}} function, which provides additional control over plotting parameters. Please visit \url{https://github.com/briatte/ggnet} for @@ -247,3 +249,4 @@ package Moritz Marbach and Francois Briatte, with help from Heike Hofmann, Pedro Jordano and Ming-Yu Liu } +\keyword{internal} diff --git a/man/v1_ggmatrix_theme.Rd b/man/v1_ggmatrix_theme.Rd index 87e8ed47..a2e2d2e0 100644 --- a/man/v1_ggmatrix_theme.Rd +++ b/man/v1_ggmatrix_theme.Rd @@ -7,13 +7,39 @@ v1_ggmatrix_theme() } \description{ -Modify a \code{\link{ggmatrix}} object by adding an \pkg{ggplot2} object to all +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +This function allows cleaner axis labels for your plots, but is deprecated. +You can achieve the same effect by specifying strip's background and placement +properties (see Examples). } \examples{ # Small function to display plots only if it's interactive p_ <- GGally::print_if_interactive +# Cleaner axis labels with v1_ggmatrix_theme p_(ggpairs(iris, 1:2) + v1_ggmatrix_theme()) -# move the column names to the left and bottom + +# Move the column names to the left and bottom p_(ggpairs(iris, 1:2, switch = "both") + v1_ggmatrix_theme()) + +# Manually specifying axis labels properties +p_( + ggpairs(iris, 1:2) + + theme( + strip.background = element_rect(fill = "white"), + strip.placement = "outside" + ) +) + +# This way you have even more control over how the final plot looks. +# For example, if you want to set the background color to yellow: +p_( + ggpairs(iris, 1:2) + + theme( + strip.background = element_rect(fill = "yellow"), + strip.placement = "outside" + ) +) } +\keyword{internal} diff --git a/tests/testthat/_snaps/deprecated.md b/tests/testthat/_snaps/deprecated.md new file mode 100644 index 00000000..d0090d00 --- /dev/null +++ b/tests/testthat/_snaps/deprecated.md @@ -0,0 +1,32 @@ +# v1_ggmatrix_theme() is deprecated + + Code + v1_ggmatrix_theme() + Condition + Warning: + `v1_ggmatrix_theme()` was deprecated in GGally 2.2.2. + i This function will be removed in future releases. + Output + List of 2 + $ strip.background:List of 5 + ..$ fill : chr "white" + ..$ colour : NULL + ..$ linewidth : NULL + ..$ linetype : NULL + ..$ inherit.blank: logi FALSE + ..- attr(*, "class")= chr [1:2] "element_rect" "element" + $ strip.placement : chr "outside" + - attr(*, "class")= chr [1:2] "theme" "gg" + - attr(*, "complete")= logi FALSE + - attr(*, "validate")= logi TRUE + +# ggally_cor_v1_5() is deprecated + + Code + p <- ggally_cor_v1_5(tips, ggplot2::aes(!!as.name("total_bill"), !!as.name( + "tip"))) + Condition + Warning: + `ggally_cor_v1_5()` was deprecated in GGally 2.2.2. + i Please use `ggally_cor()` instead. + diff --git a/tests/testthat/_snaps/ggmatrix_add.md b/tests/testthat/_snaps/ggmatrix_add.md new file mode 100644 index 00000000..de8f22a2 --- /dev/null +++ b/tests/testthat/_snaps/ggmatrix_add.md @@ -0,0 +1,13 @@ +# v1_ggmatrix_theme + + Code + pm <- ggpairs(tips, 1:2) + pm1 <- pm + v1_ggmatrix_theme() + Condition + Warning: + `v1_ggmatrix_theme()` was deprecated in GGally 2.2.2. + i This function will be removed in future releases. + Code + expect_true(is.null(pm$gg)) + expect_true(!is.null(pm1$gg)) + diff --git a/tests/testthat/test-deprecated.R b/tests/testthat/test-deprecated.R index d573db1c..7b48a5ac 100644 --- a/tests/testthat/test-deprecated.R +++ b/tests/testthat/test-deprecated.R @@ -1,8 +1,21 @@ - data(tips) -test_that("ggally-cor", { - expect_silent( +test_that("ggally_cor_v1_5() works", { + lifecycle::expect_deprecated( + { + p <- ggally_cor_v1_5(tips, ggplot2::aes(!!as.name("total_bill"), !!as.name("tip"))) + } + ) +}) + +test_that("v1_ggmatrix_theme() is deprecated", { + expect_snapshot( + v1_ggmatrix_theme() + ) +}) + +test_that("ggally_cor_v1_5() is deprecated", { + expect_snapshot( p <- ggally_cor_v1_5(tips, ggplot2::aes(!!as.name("total_bill"), !!as.name("tip"))) ) }) diff --git a/tests/testthat/test-ggmatrix.R b/tests/testthat/test-ggmatrix.R index 0dd714c0..198ce670 100644 --- a/tests/testthat/test-ggmatrix.R +++ b/tests/testthat/test-ggmatrix.R @@ -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") }) }) diff --git a/tests/testthat/test-ggmatrix_add.R b/tests/testthat/test-ggmatrix_add.R index c085e972..7c2411af 100644 --- a/tests/testthat/test-ggmatrix_add.R +++ b/tests/testthat/test-ggmatrix_add.R @@ -50,10 +50,14 @@ test_that("add_list", { }) test_that("v1_ggmatrix_theme", { - pm <- ggpairs(tips, 1:2) + expect_snapshot( + { + pm <- ggpairs(tips, 1:2) - pm1 <- pm + v1_ggmatrix_theme() + pm1 <- pm + v1_ggmatrix_theme() - expect_true(is.null(pm$gg)) - expect_true(!is.null(pm1$gg)) + expect_true(is.null(pm$gg)) + expect_true(!is.null(pm1$gg)) + } + ) }) diff --git a/tests/testthat/test-ggnet.R b/tests/testthat/test-ggnet.R index 23f37fab..589749e5 100644 --- a/tests/testthat/test-ggnet.R +++ b/tests/testthat/test-ggnet.R @@ -49,10 +49,10 @@ test_that("examples", { xy <- gplot.layout.circle(n) # nolint n %v% "lon" <- xy[, 1] n %v% "lat" <- xy[, 2] - expect_warning(ggnet(n, mode = "geo"), "deprecated") + lifecycle::expect_deprecated(ggnet(n, mode = "geo")) # test names = c(x, y) - expect_warning(ggnet(n, names = c("a", "b")), "deprecated") + lifecycle::expect_deprecated(ggnet(n, names = c("a", "b"))) # test quantize.weights with_options(list(warn = 2), { @@ -62,14 +62,14 @@ test_that("examples", { # test subset.threshold suppressMessages({ - expect_warning(ggnet(n, subset.threshold = 2)) + lifecycle::expect_deprecated(ggnet(n, subset.threshold = 2)) }) # test top8.nodes - expect_warning(ggnet(n, top8.nodes = TRUE)) + lifecycle::expect_deprecated(ggnet(n, top8.nodes = TRUE)) # test trim.labels - expect_warning(ggnet(n, trim.labels = TRUE)) + lifecycle::expect_deprecated(ggnet(n, trim.labels = TRUE)) # # test subset.threshold by removing all nodes # expect_warning(