Skip to content

Commit

Permalink
Use group_var argument to control_lineplot_vars instead of deprec…
Browse files Browse the repository at this point in the history
…ated `strata` (#1223)

Fixes #1222
  • Loading branch information
edelarua authored Sep 6, 2024
1 parent 99c2813 commit 3ee96e5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion R/tm_g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion man/template_g_lineplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_g_lineplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/_snaps/tm_g_lineplot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3ee96e5

Please sign in to comment.