From 3ee96e5af9801eff13e2e0df77db9f0bef8421aa Mon Sep 17 00:00:00 2001 From: Emily de la Rua <59304861+edelarua@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:32:43 -0400 Subject: [PATCH] Use `group_var` argument to `control_lineplot_vars` instead of deprecated `strata` (#1223) Fixes #1222 --- DESCRIPTION | 2 +- NEWS.md | 1 + R/tm_g_lineplot.R | 3 ++- README.md | 2 +- man/template_g_lineplot.Rd | 2 +- man/tm_g_lineplot.Rd | 2 +- tests/testthat/_snaps/tm_g_lineplot.md | 4 ++-- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 942c7b1baa..5797e64be2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -60,7 +60,7 @@ Imports: teal.logger (>= 0.2.0.9004), teal.reporter (>= 0.2.1), teal.widgets (>= 0.4.0), - tern.gee (>= 0.1.4), + tern.gee (>= 0.1.5), tern.mmrm (>= 0.3.1), utils, vistime (>= 1.2.3) diff --git a/NEWS.md b/NEWS.md index c965d13d9e..22622e69ef 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,7 @@ * Clarified the documentation specifying whether multiple values can be selected in the `arm_var` argument for each module. * Replaced use of the `rtables::add_colcounts()` function with the `show_colcounts` argument to `basic_table()`. * Began deprecation cycle for the `show_labels` argument of `template_summary` which has no effect on the `tm_t_summary` module. +* Replaced instances of deprecated `strata` argument to `tern::control_lineplot_vars()` with `group_var`. # teal.modules.clinical 0.9.1 diff --git a/R/tm_g_lineplot.R b/R/tm_g_lineplot.R index 533b3a8075..fc0d58eb02 100644 --- a/R/tm_g_lineplot.R +++ b/R/tm_g_lineplot.R @@ -5,6 +5,7 @@ #' @inheritParams tern::g_lineplot #' @inheritParams tern::control_lineplot_vars #' @inheritParams template_arguments +#' @param strata (`string` or `NA`)\cr group variable name. #' @param param (`character`)\cr parameter to filter the data by. #' @param incl_screen (`logical`)\cr whether the screening visit should be included. #' @param ggplot2_args (`ggplot2_args`) optional\cr object created by [teal.widgets::ggplot2_args()] with settings @@ -94,7 +95,7 @@ template_g_lineplot <- function(dataname = "ANL", ) z$variables <- substitute( - expr = variables <- control_lineplot_vars(x = x, y = y, strata = arm, paramcd = paramcd, y_unit = y_unit), + expr = variables <- control_lineplot_vars(x = x, y = y, group_var = arm, paramcd = paramcd, y_unit = y_unit), env = list(x = x, y = y, arm = strata, paramcd = paramcd, y_unit = y_unit) ) diff --git a/README.md b/README.md index 378f153fad..d502cce440 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ install.packages('teal.modules.clinical') pak::pak("insightsengineering/teal.modules.clinical@*release") ``` -Alternatively, you might want to use the development version available on [r-universe](https://r-universe.dev/). +Alternatively, you might want to use the development version available on [r-universe](https://r-universe.dev/search). ```r # beta versions diff --git a/man/template_g_lineplot.Rd b/man/template_g_lineplot.Rd index 70cf2a02a8..f60c8b1bf8 100644 --- a/man/template_g_lineplot.Rd +++ b/man/template_g_lineplot.Rd @@ -29,7 +29,7 @@ template_g_lineplot( \arguments{ \item{dataname}{(\code{character})\cr analysis data used in teal module.} -\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{strata}{(\code{string} or \code{NA})\cr group variable name.} \item{x}{(\code{string})\cr x-variable name.} diff --git a/man/tm_g_lineplot.Rd b/man/tm_g_lineplot.Rd index 3fe9f92700..5831b28a52 100644 --- a/man/tm_g_lineplot.Rd +++ b/man/tm_g_lineplot.Rd @@ -44,7 +44,7 @@ tm_g_lineplot( \item{parentname}{(\code{character})\cr parent analysis data used in teal module, usually this refers to \code{ADSL}.} -\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{strata}{(\code{string} or \code{NA})\cr group variable name.} \item{x}{(\code{string})\cr x-variable name.} diff --git a/tests/testthat/_snaps/tm_g_lineplot.md b/tests/testthat/_snaps/tm_g_lineplot.md index 28d5b3ca9f..82e7977b32 100644 --- a/tests/testthat/_snaps/tm_g_lineplot.md +++ b/tests/testthat/_snaps/tm_g_lineplot.md @@ -10,7 +10,7 @@ $variables variables <- control_lineplot_vars(x = "AVISIT", y = "AVAL", - strata = "ARM", paramcd = "PARAMCD", y_unit = "AVALU") + group_var = "ARM", paramcd = "PARAMCD", y_unit = "AVALU") $graph { @@ -40,7 +40,7 @@ } $variables - variables <- control_lineplot_vars(x = "AVISIT", y = "CHG", strata = "ARMCD", + variables <- control_lineplot_vars(x = "AVISIT", y = "CHG", group_var = "ARMCD", paramcd = "PARAMCD", y_unit = "AVALU") $graph