Skip to content

Commit e2b62b9

Browse files
committed
Remove deprecations warnings to size
1 parent b9f6ebc commit e2b62b9

File tree

5 files changed

+15
-43
lines changed

5 files changed

+15
-43
lines changed

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Imports:
3434
ggplot2 (>= 3.4.0),
3535
ggridges (>= 0.5.5),
3636
glue,
37-
lifecycle,
3837
posterior,
3938
reshape2,
4039
rlang (>= 0.3.0),

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,3 @@ importFrom(dplyr,top_n)
224224
importFrom(dplyr,ungroup)
225225
importFrom(dplyr,vars)
226226
importFrom(ggplot2,"%+replace%")
227-
importFrom(lifecycle,deprecated)

R/ppc-censoring.R

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
#' @family PPCs
1616
#'
1717
#' @template args-y-yrep
18-
#' @param linewidth,alpha Passed to the appropriate geom to control the appearance of
18+
#' @param size,alpha Passed to the appropriate geom to control the appearance of
1919
#' the `yrep` distributions.
20-
#' @param size `r lifecycle::badge("deprecated")` Please use `linewidth` instead of `size`.
2120
#' @param ... Currently only used internally.
2221
#'
2322
#' @template return-ggplot
@@ -97,27 +96,16 @@ NULL
9796
#' posterior predictive draws may not be shown by default because of the
9897
#' controlled extrapolation. To display all posterior predictive draws, set
9998
#' `extrapolation_factor = Inf`.
100-
#' @importFrom lifecycle deprecated
10199
ppc_km_overlay <- function(
102100
y,
103101
yrep,
104102
...,
105103
status_y,
106104
left_truncation_y = NULL,
107105
extrapolation_factor = 1.2,
108-
linewidth = 0.25,
109-
size = deprecated(),
106+
size = 0.25,
110107
alpha = 0.7
111108
) {
112-
if (lifecycle::is_present(size)) {
113-
lifecycle::deprecate_warn(
114-
"1.16.0",
115-
"ppc_km_overlay(size)",
116-
details = "Please use `linewidth` instead of `size`."
117-
)
118-
linewidth <- size
119-
}
120-
121109
check_ignored_arguments(..., ok_args = "add_group")
122110
add_group <- list(...)$add_group
123111

@@ -184,7 +172,7 @@ ppc_km_overlay <- function(
184172
}
185173

186174
fsf$is_y_color <- as.factor(sub("\\[rep\\] \\(.*$", "rep", sub("^italic\\(y\\)", "y", fsf$strata)))
187-
fsf$is_y_linewidth <- ifelse(fsf$is_y_color == "yrep", linewidth, 1)
175+
fsf$is_y_linewidth <- ifelse(fsf$is_y_color == "yrep", size, 1)
188176
fsf$is_y_alpha <- ifelse(fsf$is_y_color == "yrep", alpha, 1)
189177

190178
max_time_y <- max(y, na.rm = TRUE)
@@ -229,7 +217,6 @@ ppc_km_overlay <- function(
229217
#' @export
230218
#' @rdname PPC-censoring
231219
#' @template args-group
232-
#' @importFrom lifecycle deprecated
233220
ppc_km_overlay_grouped <- function(
234221
y,
235222
yrep,
@@ -238,18 +225,9 @@ ppc_km_overlay_grouped <- function(
238225
status_y,
239226
left_truncation_y = NULL,
240227
extrapolation_factor = 1.2,
241-
linewidth = 0.25,
242-
size = deprecated(),
228+
size = 0.25,
243229
alpha = 0.7
244230
) {
245-
if (lifecycle::is_present(size)) {
246-
lifecycle::deprecate_warn(
247-
"1.16.0",
248-
"ppc_km_overlay_grouped(size)",
249-
details = "Please use `linewidth` instead of `size`."
250-
)
251-
linewidth <- size
252-
}
253231
check_ignored_arguments(...)
254232

255233
p_overlay <- ppc_km_overlay(
@@ -259,7 +237,7 @@ ppc_km_overlay_grouped <- function(
259237
...,
260238
status_y = status_y,
261239
left_truncation_y = left_truncation_y,
262-
linewidth = linewidth,
240+
size = size,
263241
alpha = alpha,
264242
extrapolation_factor = extrapolation_factor
265243
)

man/PPC-censoring.Rd

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-ppc-censoring.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ source(test_path("data-for-ppc-tests.R"))
22

33
test_that("ppc_km_overlay returns a ggplot object", {
44
skip_if_not_installed("ggfortify")
5-
expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, linewidth = 0.5, alpha = 0.2, extrapolation_factor = Inf))
6-
expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, linewidth = 0.5, alpha = 0.2, extrapolation_factor = 1))
5+
expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, size = 0.5, alpha = 0.2, extrapolation_factor = Inf))
6+
expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, size = 0.5, alpha = 0.2, extrapolation_factor = 1))
77
expect_gg(ppc_km_overlay(y2, yrep2, status_y = status_y2))
88
})
99

@@ -12,15 +12,15 @@ test_that("ppc_km_overlay_grouped returns a ggplot object", {
1212
expect_gg(ppc_km_overlay_grouped(y, yrep, group,
1313
status_y = status_y,
1414
left_truncation_y = left_truncation_y,
15-
linewidth = 0.5, alpha = 0.2))
15+
size = 0.5, alpha = 0.2))
1616
expect_gg(ppc_km_overlay_grouped(y, yrep, as.numeric(group),
1717
status_y = status_y,
1818
left_truncation_y = left_truncation_y,
19-
linewidth = 0.5, alpha = 0.2))
19+
size = 0.5, alpha = 0.2))
2020
expect_gg(ppc_km_overlay_grouped(y, yrep, as.integer(group),
2121
status_y = status_y,
2222
left_truncation_y = left_truncation_y,
23-
linewidth = 0.5, alpha = 0.2))
23+
size = 0.5, alpha = 0.2))
2424

2525
expect_gg(ppc_km_overlay_grouped(y2, yrep2, group2,
2626
status_y = status_y2))
@@ -89,7 +89,7 @@ test_that("ppc_km_overlay renders correctly", {
8989
vdiff_y2,
9090
vdiff_yrep2,
9191
status_y = vdiff_status_y2,
92-
linewidth = 2,
92+
size = 2,
9393
alpha = .2)
9494
vdiffr::expect_doppelganger("ppc_km_overlay (size, alpha)", p_custom)
9595

@@ -138,7 +138,7 @@ test_that("ppc_km_overlay_grouped renders correctly", {
138138
vdiff_yrep2,
139139
vdiff_group2,
140140
status_y = vdiff_status_y2,
141-
linewidth = 2,
141+
size = 2,
142142
alpha = .2
143143
)
144144

0 commit comments

Comments
 (0)