Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update strata var to group_var #1246

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions 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 `r lifecycle::badge("deprecated")` Please use the `group_var` argument instead.
#' @param group_var (`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.
Expand All @@ -22,6 +23,7 @@
#'
#' @keywords internal
template_g_lineplot <- function(dataname = "ANL",
strata = lifecycle::deprecated(),
group_var = "ARM",
x = "AVISIT",
y = "AVAL",
Expand All @@ -40,6 +42,15 @@ template_g_lineplot <- function(dataname = "ANL",
title = "Line Plot",
y_lab = "",
ggplot2_args = teal.widgets::ggplot2_args()) {
if (lifecycle::is_present(strata)) {
warning(
"The `strata` argument of `tm_g_lineplot()` is deprecated as of teal.modules.clinical 0.9.1. ",
ayogasekaram marked this conversation as resolved.
Show resolved Hide resolved
"Please use the `group_var` argument instead.",
call. = FALSE
)
group_var <- strata
}

checkmate::assert_string(dataname)
checkmate::assert_string(group_var)
checkmate::assert_string(x)
Expand Down Expand Up @@ -255,11 +266,8 @@ template_g_lineplot <- function(dataname = "ANL",
#' @export
tm_g_lineplot <- function(label,
dataname,
parentname = ifelse(
inherits(group_var, "data_extract_spec"),
teal.transform::datanames_input(group_var),
"ADSL"
),
parentname = NULL,
strata = lifecycle::deprecated(),
group_var = teal.transform::choices_selected(
teal.transform::variable_choices(parentname, c("ARM", "ARMCD", "ACTARMCD")), "ARM"
),
Expand Down Expand Up @@ -294,6 +302,21 @@ tm_g_lineplot <- function(label,
pre_output = NULL,
post_output = NULL,
ggplot2_args = teal.widgets::ggplot2_args()) {
if (lifecycle::is_present(strata)) {
warning(
"The `strata` argument of `tm_g_lineplot()` is deprecated as of teal.modules.clinical 0.9.1. ",
"Please use the `group_var` argument instead.",
call. = FALSE
)
group_var <- strata
}
ayogasekaram marked this conversation as resolved.
Show resolved Hide resolved

# Now handle 'parentname' calculation based on 'group_var'
parentname <- ifelse(
inherits(group_var, "data_extract_spec"),
teal.transform::datanames_input(group_var),
"ADSL"
)
ayogasekaram marked this conversation as resolved.
Show resolved Hide resolved
message("Initializing tm_g_lineplot")
checkmate::assert_string(label)
checkmate::assert_string(dataname)
Expand Down
3 changes: 3 additions & 0 deletions man/template_g_lineplot.Rd

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

6 changes: 4 additions & 2 deletions man/tm_g_lineplot.Rd

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

Loading