Skip to content

Commit bcacdde

Browse files
m7prgithub-actions[bot]gogonzo
authored
Update lifecycle badges (#1412)
Part of insightsengineering/coredev-tasks#649 Removed stable badges. Changed `depracate_warn/soft` -> `depracate_stop` for parameters deprecated before 0.9.1. On CRAN we have 0.10.0, so next one is 0.10.1 or higher. --------- Signed-off-by: Marcin <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dawid Kałędkowski <[email protected]>
1 parent f5f6863 commit bcacdde

27 files changed

+44
-200
lines changed

R/arm_ref_comp.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Observer for Treatment reference variable
22
#'
3-
#' @description `r lifecycle::badge("stable")`
3+
#' @description
44
#' Updates the reference and comparison Treatments when the selected Treatment variable changes
55
#'
66
#' @param session (`environment`)\cr shiny session
@@ -93,7 +93,7 @@ arm_ref_comp_observer <- function(session,
9393

9494
#' Check if the Treatment variable is reference or compare
9595
#'
96-
#' @description `r lifecycle::badge("stable")`
96+
#' @description Check Treatment variable type.
9797
#' @param x (`character`)\cr Name of the variable
9898
#' @param df_to_check (`data.frame`)\cr table to check
9999
#' @param module (`character`)\cr teal module the ref and comp are called in

R/facet_grid_formula.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#' Facetting formula `x_facet ~ y_facet`
44
#'
5-
#' @description `r lifecycle::badge("stable")`
5+
#' @description
66
#' Replaces `x_facet` or `y_facet` by . when empty character
77
#'
88
#' @md

R/tm_g_ipp.R

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,12 @@ template_g_ipp <- function(dataname = "ANL",
3535
avalu_var = "AVALU",
3636
id_var = "USUBJID",
3737
visit_var = "AVISIT",
38-
base_var = lifecycle::deprecated(),
3938
baseline_var = "BASE",
4039
add_baseline_hline = FALSE,
4140
separate_by_obs = FALSE,
4241
ggplot2_args = teal.widgets::ggplot2_args(),
4342
suppress_legend = FALSE,
4443
add_avalu = TRUE) {
45-
if (lifecycle::is_present(base_var)) {
46-
baseline_var <- base_var
47-
warning(
48-
"The `base_var` argument of `template_g_ipp()` is deprecated as of teal.modules.clinical 0.8.16. ",
49-
"Please use the `baseline_var` argument instead.",
50-
call. = FALSE
51-
)
52-
}
5344

5445
checkmate::assert_string(dataname)
5546
checkmate::assert_string(paramcd)
@@ -175,6 +166,7 @@ template_g_ipp <- function(dataname = "ANL",
175166
#' @inheritParams module_arguments
176167
#' @inheritParams teal::module
177168
#' @inheritParams template_g_ipp
169+
#' @inheritParams template_arguments
178170
#' @param arm_var ([teal.transform::choices_selected()])\cr object with
179171
#' all available choices and preselected option for variable values that can be used as arm variable.
180172
#'
@@ -324,14 +316,11 @@ tm_g_ipp <- function(label,
324316
transformators = list(),
325317
decorators = list()) {
326318
if (lifecycle::is_present(base_var)) {
327-
baseline_var <- base_var
328-
warning(
329-
"The `base_var` argument of `tm_g_ipp()` is deprecated as of teal.modules.clinical 0.8.16. ",
330-
"Please use the `baseline_var` argument instead.",
331-
call. = FALSE
319+
lifecycle::deprecate_stop(
320+
when = "0.8.16",
321+
what = "tm_g_ipp(base_var)",
322+
details = "Please use the `baseline_var` argument instead."
332323
)
333-
} else {
334-
base_var <- baseline_var # resolves missing argument error
335324
}
336325

337326
message("Initializing tm_g_ipp")

R/tm_g_km.R

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,32 +40,10 @@ template_g_km <- function(dataname = "ANL",
4040
control_annot_surv_med = control_surv_med_annot(),
4141
control_annot_coxph = tern::control_coxph_annot(x = 0.27, y = 0.35, w = 0.3),
4242
legend_pos = NULL,
43-
position_coxph = lifecycle::deprecated(),
44-
width_annots = lifecycle::deprecated(),
4543
rel_height_plot = 0.80,
4644
ci_ribbon = FALSE,
4745
title = "KM Plot") {
48-
if (lifecycle::is_present(position_coxph)) {
49-
control_annot_coxph[["x"]] <- position_coxph[1]
50-
control_annot_coxph[["y"]] <- position_coxph[2]
51-
lifecycle::deprecate_warn(
52-
"0.8.17",
53-
"template_g_km(position_coxph)",
54-
details = "Please use the 'x' and 'y' elements of the `control_annot_coxph` argument instead."
55-
)
56-
}
57-
if (lifecycle::is_present(width_annots)) {
58-
control_annot_surv_med[["w"]] <- width_annots[["surv_med"]]
59-
control_annot_coxph[["w"]] <- width_annots[["coxph"]]
60-
lifecycle::deprecate_warn(
61-
"0.8.17",
62-
"template_g_km(width_annots)",
63-
details = paste(
64-
"Please use the 'w' element of the `control_annot_surv_med`",
65-
"and `control_annot_coxph` arguments instead."
66-
)
67-
)
68-
}
46+
6947
checkmate::assert_string(dataname)
7048
checkmate::assert_string(arm_var)
7149
checkmate::assert_string(aval_var)

R/tm_g_lineplot.R

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#' @inheritParams tern::g_lineplot
66
#' @inheritParams tern::control_lineplot_vars
77
#' @inheritParams template_arguments
8-
#' @param strata `r lifecycle::badge("deprecated")` Please use the `group_var` argument instead.
98
#' @param group_var (`string` or `NA`)\cr group variable name.
109
#' @param param (`character`)\cr parameter to filter the data by.
1110
#' @param incl_screen (`logical`)\cr whether the screening visit should be included.
@@ -23,7 +22,6 @@
2322
#'
2423
#' @keywords internal
2524
template_g_lineplot <- function(dataname = "ANL",
26-
strata = lifecycle::deprecated(),
2725
group_var = "ARM",
2826
x = "AVISIT",
2927
y = "AVAL",
@@ -42,14 +40,6 @@ template_g_lineplot <- function(dataname = "ANL",
4240
title = "Line Plot",
4341
y_lab = "",
4442
ggplot2_args = teal.widgets::ggplot2_args()) {
45-
if (lifecycle::is_present(strata)) {
46-
warning(
47-
"The `strata` argument of `template_g_lineplot()` is deprecated as of teal.modules.clinical 0.9.1. ",
48-
"Please use the `group_var` argument instead.",
49-
call. = FALSE
50-
)
51-
group_var <- strata
52-
}
5343

5444
checkmate::assert_string(dataname)
5545
checkmate::assert_string(group_var)
@@ -212,6 +202,7 @@ template_g_lineplot <- function(dataname = "ANL",
212202
#' @inheritParams module_arguments
213203
#' @inheritParams teal::module
214204
#' @inheritParams template_g_lineplot
205+
#' @param strata `r lifecycle::badge("deprecated")` Please use the `group_var` argument instead.
215206
#'
216207
#' @inherit module_arguments return seealso
217208
#'
@@ -327,14 +318,11 @@ tm_g_lineplot <- function(label,
327318
transformators = list(),
328319
decorators = list()) {
329320
if (lifecycle::is_present(strata)) {
330-
warning(
331-
"The `strata` argument of `tm_g_lineplot()` is deprecated as of teal.modules.clinical 0.9.1. ",
332-
"Please use the `group_var` argument instead.",
333-
call. = FALSE
321+
lifecycle::deprecate_stop(
322+
when = "0.9.1",
323+
what = "tm_g_lineplot(strata)",
324+
with = "tm_g_lineplot(group_var)"
334325
)
335-
group_var <- strata
336-
} else {
337-
strata <- group_var # resolves missing argument error
338326
}
339327

340328
# Now handle 'parentname' calculation based on 'group_var'

R/tm_g_pp_vitals.R

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,10 @@ template_vitals <- function(dataname = "ANL",
1515
paramcd = "PARAMCD",
1616
paramcd_levels = c("SYSBP", "DIABP", "PUL", "RESP", "OXYSAT", "WGHT", "TEMP"),
1717
xaxis = "ADY",
18-
aval = lifecycle::deprecated(),
1918
aval_var = "AVAL",
2019
patient_id,
2120
font_size = 12L,
2221
ggplot2_args = teal.widgets::ggplot2_args()) {
23-
if (lifecycle::is_present(aval)) {
24-
aval_var <- aval
25-
warning(
26-
"The `aval` argument of `template_vitals()` is deprecated as of teal.modules.clinical 0.8.16. ",
27-
"Please use the `aval_var` argument instead.",
28-
call. = FALSE
29-
)
30-
}
3122

3223
checkmate::assert_string(dataname)
3324
checkmate::assert_string(paramcd)
@@ -205,6 +196,7 @@ template_vitals <- function(dataname = "ANL",
205196
#' @inheritParams module_arguments
206197
#' @inheritParams teal::module
207198
#' @inheritParams template_vitals
199+
#' @inheritParams template_arguments
208200
#' @param xaxis ([teal.transform::choices_selected()])\cr object with all
209201
#' available choices and preselected option for the time variable from `dataname` to be put on the plot x-axis.
210202
#'
@@ -299,14 +291,11 @@ tm_g_pp_vitals <- function(label,
299291
transformators = list(),
300292
decorators = list()) {
301293
if (lifecycle::is_present(aval)) {
302-
aval_var <- aval
303-
warning(
304-
"The `aval` argument of `tm_g_pp_vitals()` is deprecated as of teal.modules.clinical 0.8.16. ",
305-
"Please use the `aval_var` argument instead.",
306-
call. = FALSE
294+
lifecycle::deprecate_stop(
295+
when = "0.8.16",
296+
what = "tm_g_pp_vitals(aval)",
297+
with = "tm_g_pp_vitals(aval_var)"
307298
)
308-
} else {
309-
aval <- aval_var # resolves missing argument error
310299
}
311300

312301
message("Initializing tm_g_pp_vitals")

R/tm_t_logistic.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#' @param topleft (`character`)\cr text to use as top-left annotation in the table.
1010
#' @param interaction_var (`character`)\cr names of the variables that can be used for interaction variable selection.
1111
#' @param responder_val (`character`)\cr values of the responder variable corresponding with a successful response.
12-
#' @param paramcd `r lifecycle::badge("deprecated")` The `paramcd` argument is not used in this function.
1312
#' @param label_paramcd (`character`)\cr label of response parameter value to print in the table title.
1413
#'
1514
#' @inherit template_arguments return
@@ -20,7 +19,6 @@
2019
template_logistic <- function(dataname,
2120
arm_var,
2221
aval_var,
23-
paramcd = lifecycle::deprecated(),
2422
label_paramcd,
2523
cov_var,
2624
interaction_var,
@@ -32,9 +30,6 @@ template_logistic <- function(dataname,
3230
responder_val = c("CR", "PR"),
3331
at = NULL,
3432
basic_table_args = teal.widgets::basic_table_args()) {
35-
if (lifecycle::is_present(paramcd)) {
36-
lifecycle::deprecate_warn("0.8.16", "template_logistic(paramcd)")
37-
}
3833

3934
# Common assertion no matter if arm_var is NULL or not.
4035
checkmate::assert_string(dataname)

R/tm_t_pp_laboratory.R

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,10 @@ template_laboratory <- function(dataname = "ANL",
1919
param = "PARAM",
2020
anrind = "ANRIND",
2121
timepoints = "ADY",
22-
aval = lifecycle::deprecated(),
2322
aval_var = "AVAL",
24-
avalu = lifecycle::deprecated(),
2523
avalu_var = "AVALU",
2624
patient_id = NULL,
2725
round_value = 0L) {
28-
if (lifecycle::is_present(aval)) {
29-
aval_var <- aval
30-
warning(
31-
"The `aval` argument of `template_laboratory()` is deprecated as of teal.modules.clinical 0.8.16. ",
32-
"Please use the `aval_var` argument instead.",
33-
call. = FALSE
34-
)
35-
}
36-
37-
if (lifecycle::is_present(avalu)) {
38-
avalu_var <- avalu
39-
warning(
40-
"The `avalu` argument of `template_laboratory()` is deprecated as of teal.modules.clinical 0.8.16. ",
41-
"Please use the `avalu_var` argument instead.",
42-
call. = FALSE
43-
)
44-
}
45-
4626
checkmate::assert_string(dataname)
4727
checkmate::assert_string(paramcd)
4828
checkmate::assert_string(param)
@@ -133,6 +113,7 @@ template_laboratory <- function(dataname = "ANL",
133113
#' @inheritParams module_arguments
134114
#' @inheritParams teal::module
135115
#' @inheritParams template_laboratory
116+
#' @inheritParams template_arguments
136117
#' @param param ([teal.transform::choices_selected()])\cr object with all
137118
#' available choices and preselected option for the `PARAM` variable from `dataname`.
138119
#' @param timepoints ([teal.transform::choices_selected()])\cr object with all
@@ -223,25 +204,19 @@ tm_t_pp_laboratory <- function(label,
223204
}
224205

225206
if (lifecycle::is_present(aval)) {
226-
aval_var <- aval
227-
warning(
228-
"The `aval` argument of `tm_t_pp_laboratory()` is deprecated as of teal.modules.clinical 0.8.16. ",
229-
"Please use the `aval_var` argument instead.",
230-
call. = FALSE
207+
lifecycle::deprecate_stop(
208+
when = "0.8.16",
209+
what = "tm_t_pp_laboratory(aval)",
210+
with = "tm_t_pp_laboratory(aval_var)"
231211
)
232-
} else {
233-
aval <- aval_var # resolves missing argument error
234212
}
235213

236214
if (lifecycle::is_present(avalu)) {
237-
avalu_var <- avalu
238-
warning(
239-
"The `avalu` argument of `tm_t_pp_laboratory()` is deprecated as of teal.modules.clinical 0.8.16. ",
240-
"Please use the `avalu_var` argument instead.",
241-
call. = FALSE
215+
lifecycle::deprecate_stop(
216+
when = "0.8.16",
217+
what = "tm_t_pp_laboratory(avalu)",
218+
with = "tm_t_pp_laboratory(avalu_var)"
242219
)
243-
} else {
244-
avalu <- avalu_var # resolves missing argument error
245220
}
246221

247222
message("Initializing tm_t_pp_laboratory")

R/tm_t_shift_by_arm.R

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,12 @@ template_shift_by_arm <- function(dataname,
2020
treatment_flag_var = "ONTRTFL",
2121
treatment_flag = "Y",
2222
aval_var = "ANRIND",
23-
base_var = lifecycle::deprecated(),
2423
baseline_var = "BNRIND",
2524
na.rm = FALSE, # nolint: object_name.
2625
na_level = tern::default_na_str(),
2726
add_total = FALSE,
2827
total_label = default_total_label(),
2928
basic_table_args = teal.widgets::basic_table_args()) {
30-
if (lifecycle::is_present(base_var)) {
31-
baseline_var <- base_var
32-
warning(
33-
"The `base_var` argument of `template_shift_by_arm()` is deprecated as of teal.modules.clinical 0.8.16. ",
34-
"Please use the `baseline_var` argument instead.",
35-
call. = FALSE
36-
)
37-
}
3829

3930
checkmate::assert_string(dataname)
4031
checkmate::assert_string(parentname)
@@ -192,6 +183,7 @@ template_shift_by_arm <- function(dataname,
192183
#' @inheritParams module_arguments
193184
#' @inheritParams teal::module
194185
#' @inheritParams template_shift_by_arm
186+
#' @inheritParams template_arguments
195187
#'
196188
#' @inherit module_arguments return seealso
197189
#'
@@ -300,14 +292,12 @@ tm_t_shift_by_arm <- function(label,
300292
transformators = list(),
301293
decorators = list()) {
302294
if (lifecycle::is_present(base_var)) {
303-
baseline_var <- base_var
304-
warning(
305-
"The `base_var` argument of `tm_t_shift_by_arm()` is deprecated as of teal.modules.clinical 0.8.16. ",
306-
"Please use the `baseline_var` argument instead.",
307-
call. = FALSE
295+
lifecycle::deprecate_stop(
296+
when = "0.8.16",
297+
what = "tm_t_shift_by_arm(base_var)",
298+
details = "Please use the `baseline_var` argument instead."
308299
)
309-
} else {
310-
base_var <- baseline_var # resolves missing argument error
300+
baseline_var <- base_var
311301
}
312302

313303
message("Initializing tm_t_shift_by_arm")

0 commit comments

Comments
 (0)