Skip to content

Commit 78ca90e

Browse files
authored
Merge pull request #46 from teunbrand/compat_ggplot2_400
Compatibility ggplot2 4.0.0
2 parents 3ebcb92 + 66b81bd commit 78ca90e

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Encoding: UTF-8
2121
Imports:
2222
dplyr,
2323
ggrepel,
24-
ggplot2,
24+
ggplot2 (>= 3.5.2),
2525
scales,
2626
rlang
2727
RoxygenNote: 7.3.1

R/classes_methods.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ new_funnel_plot <- function(x = list()) {
1919

2020
validate_funnel_plot <- function(funnelplot){
2121

22-
if (!is.list(funnelplot[[1]])){
22+
if (!is_ggplot(funnelplot[[1]])){
2323
stop(
2424
"Invalid ggplot object"
2525
)

tests/testthat/test-classes_methods.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test_that("`test the classes return stuff", {
99
expect_s3_class(a, "funnelplot")
1010
expect_equal(round(phi.funnelplot(a),6), 2.948033)
1111
expect_type(a, "list")
12-
expect_type(a[[1]], "list")
12+
expect_true(is_ggplot(a[[1]]))
1313
expect_s3_class(a[[2]], "data.frame")
1414
expect_s3_class(a[[3]], "data.frame")
1515
expect_length(a[[3]]$group,6)

tests/testthat/test-funnel_plot.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_that("`funnel_plot()` works with input and returns expected list", {
66

77
a<-funnel_plot(dt, num, denom, group)
88
expect_type(a, "list")
9-
expect_type(a[[1]], "list")
9+
expect_true(is_ggplot(a[[1]]))
1010
expect_s3_class(a[[2]], "data.frame")
1111
expect_s3_class(a[[3]], "data.frame")
1212
expect_length(a[[3]]$group,6)
@@ -16,7 +16,7 @@ test_that("`funnel_plot()` works with input and returns expected list", {
1616
title="My test Funnel Plot", multiplier = 100, x_label = "Expected Values",
1717
y_label = "Standardised Ratio Test", label = "outlier", limit=95)
1818
expect_type(b, "list")
19-
expect_type(b[[1]], "list")
19+
expect_true(is_ggplot(b[[1]]))
2020
expect_s3_class(b[[2]], "data.frame")
2121
expect_s3_class(b[[3]], "data.frame")
2222
expect_length(b[[3]]$group,6)
@@ -27,7 +27,7 @@ test_that("`funnel_plot()` works with input and returns expected list", {
2727
title="My test Funnel Plot", multiplier = 100, x_label = "Expected Values",
2828
y_label = "Standardised Ratio Test", label = "highlight", limit=95, highlight="a")
2929
expect_type(c, "list")
30-
expect_type(c[[1]], "list")
30+
expect_true(is_ggplot(c[[1]]))
3131
expect_s3_class(c[[2]], "data.frame")
3232
expect_s3_class(c[[3]], "data.frame")
3333
expect_length(c[[3]]$group,6)
@@ -40,7 +40,7 @@ test_that("`funnel_plot()` works with input and returns expected list", {
4040
y_label = "Standardised Ratio Test", label = "both", limit=95, x_range=c(5,250)
4141
, y_range=c(0, 200), highlight="a")
4242
expect_type(d, "list")
43-
expect_type(d[[1]], "list")
43+
expect_true(is_ggplot(d[[1]]))
4444
expect_s3_class(d[[2]], "data.frame")
4545
expect_s3_class(d[[3]], "data.frame")
4646
expect_length(d[[3]]$group,6)

0 commit comments

Comments
 (0)