diff --git a/DESCRIPTION b/DESCRIPTION index b0c0499..63116f9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: ggplot2.utils Title: Selected Utilities Extending 'ggplot2' -Version: 0.3.2.9003 -Date: 2024-12-23 +Version: 0.3.3 +Date: 2025-06-27 Authors@R: c( person("Daniel", "Sabanés Bové", , "daniel.sabanes_bove@rconis.com", role = c("aut", "cre")), person("Samer", "Mouksassi", role = "aut", diff --git a/NEWS.md b/NEWS.md index 7f2edef..0fdcb6a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# ggplot2.utils 0.3.2.9003 +# ggplot2.utils 0.3.3 + +* Generalized one test to comply with the new `ggplot2` version. + +# ggplot2.utils 0.3.2 * Replaced dependency on `GGally` with `ggstats` where the original functions are actually from. This also avoids the corresponding overwrite messages coming from `GGally` when loading this package. diff --git a/tests/testthat/test-geom_km.R b/tests/testthat/test-geom_km.R index 5649460..2dd7dc7 100644 --- a/tests/testthat/test-geom_km.R +++ b/tests/testthat/test-geom_km.R @@ -7,11 +7,21 @@ test_that("geom_km works as expected", { first_layer <- layer_data(result, 1) expect_data_frame(first_layer) - expect_named( - first_layer, - c( - "x", "y", "time", "survival", "PANEL", "group", "colour", "fill", - "linewidth", "linetype", "weight", "alpha" + expect_names( + names(first_layer), + must.include = c( + "x", + "y", + "time", + "survival", + "PANEL", + "group", + "colour", + "fill", + "linewidth", + "linetype", + "weight", + "alpha" ) ) }) @@ -23,7 +33,10 @@ test_that("geom_km looks as expected for a single group", { }) test_that("geom_km looks as expected for two groups", { - p <- ggplot(surv_df, aes(time = time, status = status, color = factor(group))) + + p <- ggplot( + surv_df, + aes(time = time, status = status, color = factor(group)) + ) + geom_km() vdiffr::expect_doppelganger("geom_km two groups", p) }) diff --git a/tests/testthat/test-geom_km_ticks.R b/tests/testthat/test-geom_km_ticks.R index 22979a8..c93cac4 100644 --- a/tests/testthat/test-geom_km_ticks.R +++ b/tests/testthat/test-geom_km_ticks.R @@ -7,12 +7,24 @@ test_that("geom_km_ticks works as expected", { first_layer <- layer_data(result, 1) expect_data_frame(first_layer) - expect_named( - first_layer, - c( - "x", "y", "time", "survival", "n.risk", "n.censor", "n.event", - "PANEL", "group", "shape", "colour", "size", "alpha", - "stroke", "fill" + expect_names( + names(first_layer), + must.include = c( + "x", + "y", + "time", + "survival", + "n.risk", + "n.censor", + "n.event", + "PANEL", + "group", + "shape", + "colour", + "size", + "alpha", + "stroke", + "fill" ) ) }) @@ -24,7 +36,10 @@ test_that("geom_km_ticks looks as expected for a single group", { }) test_that("geom_km_ticks looks as expected for two groups", { - p <- ggplot(surv_df, aes(time = time, status = status, color = factor(group))) + + p <- ggplot( + surv_df, + aes(time = time, status = status, color = factor(group)) + ) + geom_km_ticks() vdiffr::expect_doppelganger("geom_km_ticks two groups", p) }) diff --git a/tests/testthat/test-stat_km.R b/tests/testthat/test-stat_km.R index e6c7dc6..88f4e77 100644 --- a/tests/testthat/test-stat_km.R +++ b/tests/testthat/test-stat_km.R @@ -7,11 +7,21 @@ test_that("stat_km works as expected", { first_layer <- layer_data(result, 1) expect_data_frame(first_layer) - expect_named( - first_layer, - c( - "x", "y", "time", "survival", "PANEL", "group", "colour", "fill", - "linewidth", "linetype", "weight", "alpha" + expect_names( + names(first_layer), + must.include = c( + "x", + "y", + "time", + "survival", + "PANEL", + "group", + "colour", + "fill", + "linewidth", + "linetype", + "weight", + "alpha" ) ) }) diff --git a/tests/testthat/test-stat_km_ticks.R b/tests/testthat/test-stat_km_ticks.R index b38cd1c..dc55a6a 100644 --- a/tests/testthat/test-stat_km_ticks.R +++ b/tests/testthat/test-stat_km_ticks.R @@ -7,12 +7,24 @@ test_that("stat_km_ticks works as expected", { first_layer <- layer_data(result, 1) expect_data_frame(first_layer) - expect_named( - first_layer, - c( - "x", "y", "time", "survival", "n.risk", "n.censor", "n.event", - "PANEL", "group", "shape", "colour", "size", "alpha", - "stroke", "fill" + expect_names( + names(first_layer), + must.include = c( + "x", + "y", + "time", + "survival", + "n.risk", + "n.censor", + "n.event", + "PANEL", + "group", + "shape", + "colour", + "size", + "alpha", + "stroke", + "fill" ) ) })