Skip to content

Commit

Permalink
Merge c85816d into 27dd15e
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua authored Mar 2, 2023
2 parents 27dd15e + c85816d commit 4053160
Show file tree
Hide file tree
Showing 67 changed files with 4,639 additions and 5,419 deletions.
7 changes: 2 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ Suggests:
forcats,
knitr,
nestcolor (>= 0.1.0),
scda (>= 0.1.5),
scda.2022 (>= 0.1.3),
teal.data (>= 0.1.2),
testthat (>= 2.0)
testthat (>= 3.0)
VignetteBuilder:
knitr
Remotes:
insightsengineering/scda.2022@*release,
insightsengineering/scda@*release,
insightsengineering/teal.code@*release,
insightsengineering/teal.data@*release,
insightsengineering/teal.logger@*release,
Expand All @@ -86,6 +82,7 @@ Remotes:
insightsengineering/tern.mmrm@*release,
insightsengineering/tern@*release
Config/Needs/website: insightsengineering/nesttemplate
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
automatically determined optimizer.
* Creation of internal data for `adsl`, `adae`, `adaette`, `adcm`, `adeg`, `adex`, `adlb`, `admh`, `adqs`, `adrs`, `adtte`, and `advs`.
They are accessible via `tmc_ex_*` prefix.
* Partial substitution of `scda` data with internal data in examples.
* Updated all examples and tests to use datasets from the `teal.modules.clinical` package instead of `scda` datasets.
* Updated tests to use `testthat` 3rd edition and replaced all applicable tests with snapshot testing.

# teal.modules.clinical 0.8.14

Expand Down
25 changes: 10 additions & 15 deletions R/teal.modules.clinical.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,20 @@
#' @import teal
#' @import tern
#' @importFrom magrittr %>%
#' @importFrom rlang :=
#' @importFrom methods is
#' @importFrom rlang := .data
#' @importFrom tern.gee lsmeans
#'
#' @docType package
#' @name teal.modules.clinical
#' @keywords internal
NULL

# We need this to avoid R CMD check warning about missing global definitions.
if (getRversion() >= "2.15.1") {
utils::globalVariables(c(
"new_arm_ref_comp",
"new_comp_arm",
"usubjid"
))
}

#' Avoiding R CMD check notes
#' @importFrom methods is
#' @importFrom rlang .data
#' @importFrom tern.gee lsmeans
#' @noRd
NULL
utils::globalVariables(c(
"column_name",
"n_column_name",
"new_arm_ref_comp",
"new_comp_arm",
"usubjid"
))
87 changes: 29 additions & 58 deletions R/tm_g_pp_patient_timeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,27 +356,24 @@ template_patient_timeline <- function(dataname = "ANL",
#' @examples
#' library(nestcolor)
#'
#' ADSL <- tmc_ex_adsl
#' ADAE <- tmc_ex_adae
#' ADCM <- tmc_ex_adcm
#' adsl <- tmc_ex_adsl
#' adae <- tmc_ex_adae
#' adcm <- tmc_ex_adcm
#'
#' # Modify ADCM
#' ADCM$CMINDC <- paste0("Indication_", as.numeric(ADCM$CMDECOD))
#' ADCM$CMDOSE <- 1
#' ADCM$CMDOSU <- "U"
#' ADCM$CMROUTE <- "CMROUTE"
#' ADCM$CMDOSFRQ <- "CMDOSFRQ"
#' ADCM$CMSTDY <- 1
#' ADCM[ADCM$CMCAT == "medcl B", ]$CMSTDY <- 20
#' ADCM[ADCM$CMCAT == "medcl C", ]$CMSTDY <- 150
#' ADCM$CMENDY <- 500
#' ADCM[ADCM$CMCAT == "medcl B", ]$CMENDY <- 700
#' ADCM[ADCM$CMCAT == "medcl C", ]$CMENDY <- 1000
#' ADCM$CMASTDTM <- ADCM$ASTDTM
#' ADCM$CMAENDTM <- ADCM$AENDTM
#' formatters::var_labels(
#' ADCM[c("CMINDC", "CMDECOD", "CMSTDY", "CMENDY")]
#' ) <- c(
#' adcm$CMDOSE <- 1
#' adcm$CMDOSU <- "U"
#' adcm$CMROUTE <- "CMROUTE"
#' adcm$CMDOSFRQ <- "CMDOSFRQ"
#' adcm$CMSTDY <- 1
#' adcm[adcm$CMCAT == "medcl B", ]$CMSTDY <- 20
#' adcm[adcm$CMCAT == "medcl C", ]$CMSTDY <- 150
#' adcm$CMENDY <- 500
#' adcm[adcm$CMCAT == "medcl B", ]$CMENDY <- 700
#' adcm[adcm$CMCAT == "medcl C", ]$CMENDY <- 1000
#' adcm$CMASTDTM <- adcm$ASTDTM
#' adcm$CMAENDTM <- adcm$AENDTM
#' formatters::var_labels(adcm[c("CMINDC", "CMDECOD", "CMSTDY", "CMENDY")]) <- c(
#' "Indication",
#' "Reported Name of Drug, Med, or Therapy",
#' "Study Day of Start of Medication",
Expand All @@ -386,35 +383,9 @@ template_patient_timeline <- function(dataname = "ANL",
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL,
#' code = 'ADSL <- synthetic_cdisc_dataset("latest", "adsl")'
#' ),
#' cdisc_dataset("ADAE", ADAE,
#' code = 'ADAE <- synthetic_cdisc_dataset("latest", "adae")'
#' ),
#' cdisc_dataset("ADCM", ADCM,
#' code = 'ADCM <- synthetic_cdisc_dataset("latest", "adcm")
#' ADCM$CMINDC <- paste0("Indication_", as.numeric(ADCM$CMDECOD))
#' ADCM$CMDOSE <- 1
#' ADCM$CMDOSU <- "U"
#' ADCM$CMROUTE <- "CMROUTE"
#' ADCM$CMDOSFRQ <- "CMDOSFRQ"
#' ADCM$CMSTDY <- 1
#' ADCM[ADCM$CMCAT == "medcl B", ]$CMSTDY <- 20
#' ADCM[ADCM$CMCAT == "medcl C", ]$CMSTDY <- 150
#' ADCM$CMENDY <- 500
#' ADCM[ADCM$CMCAT == "medcl B", ]$CMENDY <- 700
#' ADCM[ADCM$CMCAT == "medcl C", ]$CMENDY <- 1000
#' ADCM$CMASTDTM <- ADCM$ASTDTM
#' ADCM$CMAENDTM <- ADCM$AENDTM
#' formatters::var_labels(
#' ADCM[c("CMINDC", "CMDECOD", "CMSTDY", "CMENDY")]) <- c(
#' "Indication",
#' "Reported Name of Drug, Med, or Therapy",
#' "Study Day of Start of Medication",
#' "Study Day of End of Medication")',
#' keys = adcm_keys
#' )
#' cdisc_dataset("ADSL", adsl),
#' cdisc_dataset("ADAE", adae),
#' cdisc_dataset("ADCM", adcm, keys = adcm_keys)
#' ),
#' modules = modules(
#' tm_g_pp_patient_timeline(
Expand All @@ -425,43 +396,43 @@ template_patient_timeline <- function(dataname = "ANL",
#' patient_col = "USUBJID",
#' plot_height = c(600L, 200L, 2000L),
#' cmdecod = choices_selected(
#' choices = variable_choices(ADCM, "CMDECOD"),
#' choices = variable_choices(adcm, "CMDECOD"),
#' selected = "CMDECOD",
#' ),
#' aeterm = choices_selected(
#' choices = variable_choices(ADAE, "AETERM"),
#' choices = variable_choices(adae, "AETERM"),
#' selected = c("AETERM")
#' ),
#' aetime_start = choices_selected(
#' choices = variable_choices(ADAE, "ASTDTM"),
#' choices = variable_choices(adae, "ASTDTM"),
#' selected = c("ASTDTM")
#' ),
#' aetime_end = choices_selected(
#' choices = variable_choices(ADAE, "AENDTM"),
#' choices = variable_choices(adae, "AENDTM"),
#' selected = c("AENDTM")
#' ),
#' dstime_start = choices_selected(
#' choices = variable_choices(ADCM, "CMASTDTM"),
#' choices = variable_choices(adcm, "CMASTDTM"),
#' selected = c("CMASTDTM")
#' ),
#' dstime_end = choices_selected(
#' choices = variable_choices(ADCM, "CMAENDTM"),
#' choices = variable_choices(adcm, "CMAENDTM"),
#' selected = c("CMAENDTM")
#' ),
#' aerelday_start = choices_selected(
#' choices = variable_choices(ADAE, "ASTDY"),
#' choices = variable_choices(adae, "ASTDY"),
#' selected = c("ASTDY")
#' ),
#' aerelday_end = choices_selected(
#' choices = variable_choices(ADAE, "AENDY"),
#' choices = variable_choices(adae, "AENDY"),
#' selected = c("AENDY")
#' ),
#' dsrelday_start = choices_selected(
#' choices = variable_choices(ADCM, "ASTDY"),
#' choices = variable_choices(adcm, "ASTDY"),
#' selected = c("ASTDY")
#' ),
#' dsrelday_end = choices_selected(
#' choices = variable_choices(ADCM, "AENDY"),
#' choices = variable_choices(adcm, "AENDY"),
#' selected = c("AENDY")
#' )
#' )
Expand Down
87 changes: 29 additions & 58 deletions man/tm_g_pp_patient_timeline.Rd

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

Loading

0 comments on commit 4053160

Please sign in to comment.