diff --git a/NEWS.md b/NEWS.md index 11daaa6079..bd3afce96a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -20,6 +20,7 @@ ### Miscellaneous * Began deprecation of the confusing functions `summary_formats` and `summary_labels`. * Enhanced general descriptions of analyze and summarize functions throughout package documentation. +* Finalized deprecation of the `strata` and `cohort_id` arguments to `g_lineplot`. # tern 0.9.5 diff --git a/R/argument_convention.R b/R/argument_convention.R index 34c92b7786..e2b64b31c1 100644 --- a/R/argument_convention.R +++ b/R/argument_convention.R @@ -31,7 +31,6 @@ #' @param conf_level (`proportion`)\cr confidence level of the interval. #' @param data (`data.frame`)\cr the dataset containing the variables to summarize. #' @param df (`data.frame`)\cr data set containing all analysis variables. -#' @param draw (`flag`)\cr whether the plot should be drawn. #' @param groups_lists (named `list` of `list`)\cr optionally contains for each `subgroups` variable a #' list, which specifies the new group levels via the names and the #' levels that belong to it in the character vectors that are elements of the list. @@ -49,8 +48,6 @@ #' @param nested (`flag`)\cr whether this layout instruction should be applied within the existing layout structure _if #' possible (`TRUE`, the default) or as a new top-level element (`FALSE`). Ignored if it would nest a split. #' underneath analyses, which is not allowed. -#' @param newpage (`flag`)\cr whether the plot should be drawn on a new page. -#' Only considered if `draw = TRUE` is used. #' @param prune_zero_rows (`flag`)\cr whether to prune all zero rows. #' @param riskdiff (`flag`)\cr whether a risk difference column is present. When set to `TRUE`, [add_riskdiff()] must be #' used as `split_fun` in the prior column split of the table layout, specifying which columns should be compared. @@ -72,7 +69,6 @@ #' @param ylim (`numeric(2)`)\cr vector containing lower and upper limits for the y-axis, respectively. #' If `NULL` (default), the default scale range is used. #' -#' #' @details Although this function just returns `NULL` it has two uses, for #' the `tern` users it provides a documentation of arguments that are #' commonly and consistently used in the framework. For the developer it adds a diff --git a/R/g_forest.R b/R/g_forest.R index 35c2844f0e..b1709ea88e 100644 --- a/R/g_forest.R +++ b/R/g_forest.R @@ -182,19 +182,19 @@ g_forest <- function(tbl, # Deprecated argument warnings if (lifecycle::is_present(width_row_names)) { lifecycle::deprecate_warn( - "0.9.3", "g_forest(width_row_names)", "g_forest(lbl_col_padding)", + "0.9.4", "g_forest(width_row_names)", "g_forest(lbl_col_padding)", details = "The width of the row label column can be adjusted via the `lbl_col_padding` parameter." ) } if (lifecycle::is_present(width_forest)) { lifecycle::deprecate_warn( - "0.9.3", "g_forest(width_forest)", "g_forest(rel_width_forest)", + "0.9.4", "g_forest(width_forest)", "g_forest(rel_width_forest)", details = "Relative width of the forest plot (as a proportion) can be set via the `rel_width_forest` parameter." ) } if (lifecycle::is_present(gp)) { lifecycle::deprecate_warn( - "0.9.3", "g_forest(gp)", "g_forest(ggtheme)", + "0.9.4", "g_forest(gp)", "g_forest(ggtheme)", details = paste( "`g_forest` is now generated as a `ggplot` object.", "Additional display settings should be supplied via the `ggtheme` parameter." @@ -203,13 +203,13 @@ g_forest <- function(tbl, } if (lifecycle::is_present(draw)) { lifecycle::deprecate_warn( - "0.9.3", "g_forest(draw)", + "0.9.4", "g_forest(draw)", details = "`g_forest` now generates `ggplot` objects. This parameter has no effect." ) } if (lifecycle::is_present(newpage)) { lifecycle::deprecate_warn( - "0.9.3", "g_forest(newpage)", + "0.9.4", "g_forest(newpage)", details = "`g_forest` now generates `ggplot` objects. This parameter has no effect." ) } diff --git a/R/g_lineplot.R b/R/g_lineplot.R index a234e835b3..82589e18ed 100644 --- a/R/g_lineplot.R +++ b/R/g_lineplot.R @@ -548,9 +548,7 @@ h_format_row <- function(x, format, labels = NULL) { #' @param x (`string`)\cr x-variable name. #' @param y (`string`)\cr y-variable name. #' @param group_var (`string` or `NA`)\cr group variable name. -#' @param strata `r lifecycle::badge("deprecated")` use the `group_var` parameter instead. #' @param subject_var (`string` or `NA`)\cr subject variable name. -#' @param cohort_id `r lifecycle::badge("deprecated")` use the `subject_var` parameter instead. #' @param facet_var (`string` or `NA`)\cr faceting variable name. #' @param paramcd (`string` or `NA`)\cr parameter code variable name. #' @param y_unit (`string` or `NA`)\cr y-axis unit variable name. @@ -568,19 +566,7 @@ control_lineplot_vars <- function(x = "AVISIT", facet_var = NA, paramcd = "PARAMCD", y_unit = "AVALU", - subject_var = "USUBJID", - strata = lifecycle::deprecated(), - cohort_id = lifecycle::deprecated()) { - if (lifecycle::is_present(strata)) { - lifecycle::deprecate_warn("0.9.2", "control_lineplot_vars(strata)", "control_lineplot_vars(group_var)") - group_var <- strata - } - - if (lifecycle::is_present(cohort_id)) { - lifecycle::deprecate_warn("0.9.2", "control_lineplot_vars(cohort_id)", "control_lineplot_vars(subject_id)") - subject_id <- cohort_id - } - + subject_var = "USUBJID") { checkmate::assert_string(x) checkmate::assert_string(y) checkmate::assert_string(group_var, na.ok = TRUE, null.ok = TRUE) diff --git a/R/h_km.R b/R/h_km.R index e038f3fa5a..bc7dd6b06d 100644 --- a/R/h_km.R +++ b/R/h_km.R @@ -188,7 +188,7 @@ h_tbl_coxph_pairwise <- function(df, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `h_tbl_coxph_pairwise() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/h_response_biomarkers_subgroups.R b/R/h_response_biomarkers_subgroups.R index 43088f2200..706bf247c0 100644 --- a/R/h_response_biomarkers_subgroups.R +++ b/R/h_response_biomarkers_subgroups.R @@ -49,7 +49,7 @@ h_rsp_to_logistic_variables <- function(variables, biomarker) { if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `h_rsp_to_logistic_variables() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] @@ -106,7 +106,7 @@ h_logistic_mult_cont_df <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `h_logistic_mult_cont_df() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/h_response_subgroups.R b/R/h_response_subgroups.R index 173ef292c0..9d968fdf13 100644 --- a/R/h_response_subgroups.R +++ b/R/h_response_subgroups.R @@ -328,7 +328,7 @@ h_odds_ratio_subgroups_df <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `h_odds_ratio_subgroups_df() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/h_survival_biomarkers_subgroups.R b/R/h_survival_biomarkers_subgroups.R index 9f9de3f34d..cb5519b0c9 100644 --- a/R/h_survival_biomarkers_subgroups.R +++ b/R/h_survival_biomarkers_subgroups.R @@ -110,7 +110,7 @@ h_coxreg_mult_cont_df <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `h_coxreg_mult_cont_df() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/h_survival_duration_subgroups.R b/R/h_survival_duration_subgroups.R index 69ac0c62f0..fcc6680e9a 100644 --- a/R/h_survival_duration_subgroups.R +++ b/R/h_survival_duration_subgroups.R @@ -335,7 +335,7 @@ h_coxph_subgroups_df <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `h_coxph_subgroups_df() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/response_biomarkers_subgroups.R b/R/response_biomarkers_subgroups.R index 360432998b..b18ad598ae 100644 --- a/R/response_biomarkers_subgroups.R +++ b/R/response_biomarkers_subgroups.R @@ -195,7 +195,7 @@ extract_rsp_biomarkers <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `extract_rsp_biomarkers() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/response_subgroups.R b/R/response_subgroups.R index c7c61d4b94..d80924d4e4 100644 --- a/R/response_subgroups.R +++ b/R/response_subgroups.R @@ -99,7 +99,7 @@ extract_rsp_subgroups <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `extract_rsp_subgroups() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/survival_biomarkers_subgroups.R b/R/survival_biomarkers_subgroups.R index c527f0209e..72cffb2334 100644 --- a/R/survival_biomarkers_subgroups.R +++ b/R/survival_biomarkers_subgroups.R @@ -116,7 +116,7 @@ extract_survival_biomarkers <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `extract_survival_biomarkers() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/survival_coxph_pairwise.R b/R/survival_coxph_pairwise.R index 4495962290..88ec24b68e 100644 --- a/R/survival_coxph_pairwise.R +++ b/R/survival_coxph_pairwise.R @@ -47,7 +47,7 @@ s_coxph_pairwise <- function(df, strat = lifecycle::deprecated(), control = control_coxph()) { if (lifecycle::is_present(strat)) { - lifecycle::deprecate_warn("0.9.3", "s_coxph_pairwise(strat)", "s_coxph_pairwise(strata)") + lifecycle::deprecate_warn("0.9.4", "s_coxph_pairwise(strat)", "s_coxph_pairwise(strata)") strata <- strat } diff --git a/R/survival_duration_subgroups.R b/R/survival_duration_subgroups.R index 90fc9b2376..eab7e46b9b 100644 --- a/R/survival_duration_subgroups.R +++ b/R/survival_duration_subgroups.R @@ -123,7 +123,7 @@ extract_survival_subgroups <- function(variables, if ("strat" %in% names(variables)) { warning( "Warning: the `strat` element name of the `variables` list argument to `extract_survival_subgroups() ", - "was deprecated in tern 0.9.3.\n ", + "was deprecated in tern 0.9.4.\n ", "Please use the name `strata` instead of `strat` in the `variables` argument." ) variables[["strata"]] <- variables[["strat"]] diff --git a/R/utils_default_stats_formats_labels.R b/R/utils_default_stats_formats_labels.R index 34cc8937a1..fc11ce3fed 100644 --- a/R/utils_default_stats_formats_labels.R +++ b/R/utils_default_stats_formats_labels.R @@ -514,7 +514,7 @@ tern_default_labels <- c( #' @export summary_formats <- function(type = "numeric", include_pval = FALSE) { lifecycle::deprecate_warn( - "0.9.5.9005", "summary_formats()", + "0.9.6", "summary_formats()", details = 'Use get_formats_from_stats(get_stats("analyze_vars_numeric", add_pval = include_pval)) instead' ) met_grp <- paste0(c("analyze_vars", type), collapse = "_") @@ -537,7 +537,7 @@ summary_formats <- function(type = "numeric", include_pval = FALSE) { #' @export summary_labels <- function(type = "numeric", include_pval = FALSE) { lifecycle::deprecate_warn( - "0.9.5.9005", "summary_formats()", + "0.9.6", "summary_formats()", details = 'Use get_labels_from_stats(get_stats("analyze_vars_numeric", add_pval = include_pval)) instead' ) met_grp <- paste0(c("analyze_vars", type), collapse = "_") diff --git a/man/argument_convention.Rd b/man/argument_convention.Rd index 7b13f98616..775937acba 100644 --- a/man/argument_convention.Rd +++ b/man/argument_convention.Rd @@ -51,8 +51,6 @@ that constitute the split. A custom label can be set for this level via the \cod \item{df}{(\code{data.frame})\cr data set containing all analysis variables.} -\item{draw}{(\code{flag})\cr whether the plot should be drawn.} - \item{groups_lists}{(named \code{list} of \code{list})\cr optionally contains for each \code{subgroups} variable a list, which specifies the new group levels via the names and the levels that belong to it in the character vectors that are elements of the list.} @@ -80,9 +78,6 @@ two proportions. For options, see \code{\link[=test_proportion_diff]{test_propor possible (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. underneath analyses, which is not allowed.} -\item{newpage}{(\code{flag})\cr whether the plot should be drawn on a new page. -Only considered if \code{draw = TRUE} is used.} - \item{prune_zero_rows}{(\code{flag})\cr whether to prune all zero rows.} \item{riskdiff}{(\code{flag})\cr whether a risk difference column is present. When set to \code{TRUE}, \code{\link[=add_riskdiff]{add_riskdiff()}} must be diff --git a/man/control_lineplot_vars.Rd b/man/control_lineplot_vars.Rd index cf52768f5e..33dd7b3838 100644 --- a/man/control_lineplot_vars.Rd +++ b/man/control_lineplot_vars.Rd @@ -11,9 +11,7 @@ control_lineplot_vars( facet_var = NA, paramcd = "PARAMCD", y_unit = "AVALU", - subject_var = "USUBJID", - strata = lifecycle::deprecated(), - cohort_id = lifecycle::deprecated() + subject_var = "USUBJID" ) } \arguments{ @@ -30,10 +28,6 @@ control_lineplot_vars( \item{y_unit}{(\code{string} or \code{NA})\cr y-axis unit variable name.} \item{subject_var}{(\code{string} or \code{NA})\cr subject variable name.} - -\item{strata}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} use the \code{group_var} parameter instead.} - -\item{cohort_id}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} use the \code{subject_var} parameter instead.} } \value{ A named character vector of variable names. diff --git a/tests/testthat/test-g_lineplot.R b/tests/testthat/test-g_lineplot.R index 15b2b264c4..4ef5d541f1 100644 --- a/tests/testthat/test-g_lineplot.R +++ b/tests/testthat/test-g_lineplot.R @@ -138,9 +138,6 @@ testthat::test_that("g_lineplot xticks, xlim, and ylim arguments work", { testthat::test_that("control_lineplot_vars works", { testthat::expect_silent(control_lineplot_vars(group_var = NA)) - - # Deprecation warnings work - lifecycle::expect_deprecated(lifecycle::expect_deprecated(control_lineplot_vars(strata = NA, cohort_id = NA))) }) testthat::test_that("g_lineplot works with no strata (group_var) and allows points when only one strata is provided", {