Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Emily de la Rua <59304861+edelarua@users.noreply.github.com>
Signed-off-by: Abinaya Yogasekaram <73252787+ayogasekaram@users.noreply.github.com>
  • Loading branch information
ayogasekaram and edelarua authored Nov 18, 2024
1 parent e79c4fd commit 3935415
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions R/tm_g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ template_g_lineplot <- function(dataname = "ANL",
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. ",
"The `strata` argument of `template_g_lineplot()` is deprecated as of teal.modules.clinical 0.9.1. ",
"Please use the `group_var` argument instead.",
call. = FALSE
)
Expand Down Expand Up @@ -309,14 +309,18 @@ tm_g_lineplot <- function(label,
call. = FALSE
)
group_var <- strata
} else {
strata <- group_var # resolves missing argument error
}

# Now handle 'parentname' calculation based on 'group_var'
parentname <- ifelse(
inherits(group_var, "data_extract_spec"),
teal.transform::datanames_input(group_var),
"ADSL"
)
parentname <- if (is.null(parentname) {
ifelse(
inherits(group_var, "data_extract_spec"),
teal.transform::datanames_input(group_var),
"ADSL"
)
}
message("Initializing tm_g_lineplot")
checkmate::assert_string(label)
checkmate::assert_string(dataname)
Expand Down

0 comments on commit 3935415

Please sign in to comment.