Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
25 changes: 19 additions & 6 deletions tests/testthat/test-geom_km.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
})
Expand All @@ -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)
})
29 changes: 22 additions & 7 deletions tests/testthat/test-geom_km_ticks.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
})
Expand All @@ -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)
})
20 changes: 15 additions & 5 deletions tests/testthat/test-stat_km.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
})
24 changes: 18 additions & 6 deletions tests/testthat/test-stat_km_ticks.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
})
Loading