From b4fa466bbdb24bc900a3d4c818a722f1e4a7bbe5 Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Tue, 5 Mar 2024 17:15:23 +0530 Subject: [PATCH 01/19] #2302 New argument, group_var added --- NAMESPACE | 1 + NEWS.md | 1 + R/admiral-package.R | 1 + R/derive_var_trtemfl.R | 212 +++++++++++++++++++---- R/globals.R | 5 +- man/derive_var_trtemfl.Rd | 66 ++++++- tests/testthat/test-derive_var_trtemfl.R | 76 ++++++-- 7 files changed, 310 insertions(+), 52 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 1d324555c9..9ddf8c7893 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -265,6 +265,7 @@ importFrom(rlang,sym) importFrom(rlang,syms) importFrom(rlang,type_of) importFrom(rlang,warn) +importFrom(stats,lag) importFrom(stats,setNames) importFrom(stringr,str_c) importFrom(stringr,str_count) diff --git a/NEWS.md b/NEWS.md index 9127275d98..77f17cca16 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ ## Updates of Existing Functions - Created three unit tests for `get_summary_records()`. (#2304) +- `group_var` (optional) argument is added to `derive_var_trtemfl()` to derive TRTEMFL for AE data if the data are collected as one episode of AE with multiple lines. (#2302) ## Breaking Changes diff --git a/R/admiral-package.R b/R/admiral-package.R index 705e125cf8..79dee962af 100644 --- a/R/admiral-package.R +++ b/R/admiral-package.R @@ -27,4 +27,5 @@ #' @importFrom hms as_hms #' @importFrom lifecycle deprecate_warn deprecated deprecate_stop #' @importFrom stats setNames +#' @importFrom stats lag "_PACKAGE" diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 0e2f28da2c..b879c3b51f 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -45,9 +45,6 @@ #' #' @param initial_intensity Initial severity/intensity or toxicity #' -#' This derivation assumes AE data collection method as single record per AE -#' with "initial" and "most extreme" severity/intensity recorded separately. -#' #' If the argument is specified, events which start before treatment start and #' end after treatment start (or are ongoing) and worsened (i.e., the #' intensity is greater than the initial intensity), are flagged. @@ -72,6 +69,20 @@ #' *Permitted Values:* A symbol referring to a variable of the input dataset #' or `NULL` #' +#' @param group_var Grouping variable +#' +#' If the argument is specified it assumes that AE are recorded as one episode +#' of AE with multiple lines using a grouping variable. +#' +#' If the argument is specified, events which start before treatment start and +#' end after treatment start (or are ongoing) and worsened (i.e., the +#' intensity is greater than the initial intensity), are flagged. +#' +#' Once an AE record within a grouped AE is flagged, then any subsequent record +#' is also flagged regardless of the severity and within the treatment window. +#' +#' *Permitted Values:* A symbol referring to a variable of the input dataset +#' or `NULL` #' #' @details For the derivation of the new variable the following cases are #' considered in this order. The first case which applies, defines the value @@ -153,6 +164,51 @@ #' initial_intensity = AEITOXGR, #' intensity = AETOXGR #' ) %>% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) +#' +#' adae2 <- expected2 <- tribble( +#' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, +#' # before treatment +#' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", +#' "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", +#' # starting before treatment and ending during treatment +#' "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", +#' "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", +#' "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", +#' # starting during treatment +#' "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", +#' +#' # after treatment +#' "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", +#' "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", +#' # missing dates +#' "1", "", "", "3", "4", "5", +#' "1", "2021-12-30T09:00", "", "3", "4", "5", +#' "1", "2021-12-30T11:00", "", "3", "3", "5", +#' "1", "", "2022-01-04T09:00", "3", "4", "5", +#' "1", "", "2021-12-24T19:00", "3", "4", "5", +#' "1", "", "2022-06-04T09:00", "3", "4", "5", +#' # without treatment +#' "2", "", "2021-12-03T12:00", "1", "2", "1", +#' "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", +#' "2", "2021-12-06T18:00", "", "1", "2", "3" +#' ) %>% +#' mutate( +#' ASTDTM = ymd_hm(ASTDTM), +#' AENDTM = ymd_hm(AENDTM), +#' TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")), +#' TRTEDTM = if_else(USUBJID == "1", ymd_hm("2022-04-30T23:59"), ymd_hms("")) +#' ) +#' +#' # derive TRTEMFL taking treatment end and worsening into account within a grouping variable +#' derive_var_trtemfl( +#' adae2, +#' new_var = TRTEMFL, +#' trt_end_date = TRTEDTM, +#' end_window = 10, +#' initial_intensity = AEITOXGR, +#' intensity = AETOXGR, +#' group_var = AEGRPID +#' ) %>% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, AEGRPID, TRTEMFL) derive_var_trtemfl <- function(dataset, new_var = TRTEMFL, start_date = ASTDTM, @@ -162,16 +218,23 @@ derive_var_trtemfl <- function(dataset, end_window = NULL, ignore_time_for_trt_end = TRUE, initial_intensity = NULL, - intensity = NULL) { + intensity = NULL, + group_var = NULL) { + # Convert inputs to symbols new_var <- assert_symbol(enexpr(new_var)) start_date <- assert_symbol(enexpr(start_date)) end_date <- assert_symbol(enexpr(end_date)) trt_start_date <- assert_symbol(enexpr(trt_start_date)) - trt_end_date <- assert_symbol(enexpr(trt_end_date), optional = TRUE) + trt_end_date <- + assert_symbol(enexpr(trt_end_date), optional = TRUE) assert_integer_scalar(end_window, subset = "non-negative", optional = TRUE) assert_logical_scalar(ignore_time_for_trt_end) - initial_intensity <- assert_symbol(enexpr(initial_intensity), optional = TRUE) + initial_intensity <- + assert_symbol(enexpr(initial_intensity), optional = TRUE) intensity <- assert_symbol(enexpr(intensity), optional = TRUE) + group_var <- assert_symbol(enexpr(group_var), optional = TRUE) + + # Check if both initial_intensity and intensity are provided if (is.null(initial_intensity) && !is.null(intensity)) { abort(paste( "`intensity` argument was specified but not `initial_intensity`", @@ -186,17 +249,21 @@ derive_var_trtemfl <- function(dataset, sep = "\n" )) } - assert_data_frame( - dataset, - required_vars = expr_c( - start_date, - end_date, - trt_start_date, - trt_end_date, - initial_intensity, - intensity - ) - ) + + # Assert required variables + required_vars <- + expr_c(start_date, + end_date, + trt_start_date, + trt_end_date, + initial_intensity, + intensity) + if (!is.null(group_var)) { + required_vars <- c(required_vars, enexpr(group_var)) + } + assert_data_frame(dataset, required_vars = required_vars) + + # Assert date variables assert_date_var(dataset, var = !!start_date) assert_date_var(dataset, var = !!end_date) assert_date_var(dataset, var = !!trt_start_date) @@ -204,38 +271,109 @@ derive_var_trtemfl <- function(dataset, assert_date_var(dataset, var = !!trt_end_date) } + # Compute TEAE flag based on the presence of group_var + if (is.null(end_window)) { end_cond <- expr(TRUE) } else { if (is.null(trt_end_date)) { - abort(paste( - "`end_window` argument was specified but not `trt_end_date`", - "Either both or none of them must be specified.", - sep = "\n" - )) + abort( + paste( + "`end_window` argument was specified but not `trt_end_date`", + "Either both or none of them must be specified.", + sep = "\n" + ) + ) } if (ignore_time_for_trt_end) { - end_cond <- expr(is.na(!!trt_end_date) | - date(!!start_date) <= date(!!trt_end_date) + days(end_window)) + end_cond <- expr( + is.na(!!trt_end_date) | + date(!!start_date) <= date(!!trt_end_date) + days(end_window) + ) } else { - end_cond <- expr(is.na(!!trt_end_date) | !!start_date <= !!trt_end_date + days(end_window)) + end_cond <- + expr(is.na(!!trt_end_date) | + !!start_date <= !!trt_end_date + days(end_window)) } } - if (is.null(intensity)) { - worsening_cond <- expr(FALSE) + if (is.null(group_var)) { + if (is.null(intensity)) { + worsening_cond <- expr(FALSE) + } else { + worsening_cond <- + expr( + !!start_date < !!trt_start_date & + ( + !!initial_intensity < !!intensity | + is.na(!!initial_intensity) | is.na(!!intensity) + ) + ) + } } else { - worsening_cond <- - expr(!!start_date < !!trt_start_date & - (!!initial_intensity < !!intensity | is.na(!!initial_intensity) | is.na(!!intensity))) + # Determine if there are multiple records per AE event + multiple_records <- dataset %>% + group_by(USUBJID, !!group_var) %>% + summarise(num_records = n(), .groups = "drop") %>% + filter(num_records > 1) %>% + nrow() > 0 + + # Compute TEAE flag based on the presence of multiple records + if (multiple_records) { + #Step 1: Identify worsened records after TRTSDT + #Step 2: Get the first worsen date after TRTSDT + dataset <- dataset %>% + arrange(USUBJID, !!group_var, !!start_date) %>% + group_by(USUBJID, !!group_var) %>% + mutate(worsen_date = case_when( + start_date >= trt_start_date & + (!!intensity > !is.na(!!initial_intensity)) ~ as_datetime(!!start_date), + TRUE ~ NA + )) %>% + ungroup() %>% + group_by(USUBJID, !!group_var) %>% + arrange(USUBJID, !!group_var, worsen_date) %>% + mutate( + first_worsen_date = ifelse(row_number() == 1, worsen_date, lag(worsen_date)), + first_worsen_date = as_datetime(first_worsen_date) + ) %>% + ungroup() + + if (is.null(intensity)) { + worsening_cond <- expr(FALSE) + } else { + worsening_cond <- + expr( + !is.na(!!dataset$first_worsen_date) & + !!trt_start_date <= !!start_date < !!trt_end_date + ) + } + dataset <- + select(dataset,-c("first_worsen_date", "worsen_date")) + } else { + if (is.null(intensity)) { + worsening_cond <- expr(FALSE) + } else { + worsening_cond <- + expr( + !!start_date < !!trt_start_date & + ( + !!initial_intensity < !!intensity | + is.na(!!initial_intensity) | is.na(!!intensity) + ) + ) + } + } } + # Derive TRTEMFL based on conditions dataset %>% - mutate(!!new_var := case_when( - is.na(!!trt_start_date) ~ NA_character_, - !!end_date < !!trt_start_date ~ NA_character_, - is.na(!!start_date) ~ "Y", - !!start_date >= !!trt_start_date & !!end_cond ~ "Y", - !!worsening_cond ~ "Y" - )) + mutate( + !!new_var := case_when( + is.na(!!trt_start_date) ~ NA_character_,!!end_date < !!trt_start_date ~ NA_character_, + is.na(!!start_date) ~ "Y",!!start_date >= !!trt_start_date & + !!end_cond ~ "Y",!!worsening_cond ~ "Y" + ) + ) %>% + ungroup() # Remove grouping for consistent behavior } diff --git a/R/globals.R b/R/globals.R index b498e406ab..e3bcc0842f 100644 --- a/R/globals.R +++ b/R/globals.R @@ -129,5 +129,8 @@ globalVariables(c( "atoxgr_criteria_ctcv4", "DTYPE", "where", # this entry should be moved to @importFrom tidyselect once we use tidyselect 1.2.0 - "tmp_col_type" + "tmp_col_type", + "num_records", + "worsen_date", + "first_worsen_date" )) diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index aa8ae90b46..776ec21aec 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -14,7 +14,8 @@ derive_var_trtemfl( end_window = NULL, ignore_time_for_trt_end = TRUE, initial_intensity = NULL, - intensity = NULL + intensity = NULL, + group_var = NULL ) } \arguments{ @@ -57,9 +58,6 @@ the event occurred more than \code{end_window} days after end of treatment. \item{initial_intensity}{Initial severity/intensity or toxicity -This derivation assumes AE data collection method as single record per AE -with "initial" and "most extreme" severity/intensity recorded separately. - If the argument is specified, events which start before treatment start and end after treatment start (or are ongoing) and worsened (i.e., the intensity is greater than the initial intensity), are flagged. @@ -81,6 +79,21 @@ The values of the specified variable must be comparable with the usual comparison operators. I.e., if the intensity is greater than the initial intensity \code{initial_intensity < intensity} must evaluate to \code{TRUE}. +\emph{Permitted Values:} A symbol referring to a variable of the input dataset +or \code{NULL}} + +\item{group_var}{Grouping variable + +If the argument is specified it assumes that AE are recorded as one episode +of AE with multiple lines using a grouping variable. + +If the argument is specified, events which start before treatment start and +end after treatment start (or are ongoing) and worsened (i.e., the +intensity is greater than the initial intensity), are flagged. + +Once an AE record within a grouped AE is flagged, then any subsequent record +is also flagged regardless of the severity and within the treatment window. + \emph{Permitted Values:} A symbol referring to a variable of the input dataset or \code{NULL}} } @@ -169,6 +182,51 @@ derive_var_trtemfl( initial_intensity = AEITOXGR, intensity = AETOXGR ) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) + +adae2 <- expected2 <- tribble( +~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, +# before treatment +"1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", +"1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", +# starting before treatment and ending during treatment +"1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", +"1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", +"1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", +# starting during treatment +"1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", + +# after treatment +"1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", +"1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", +# missing dates +"1", "", "", "3", "4", "5", +"1", "2021-12-30T09:00", "", "3", "4", "5", +"1", "2021-12-30T11:00", "", "3", "3", "5", +"1", "", "2022-01-04T09:00", "3", "4", "5", +"1", "", "2021-12-24T19:00", "3", "4", "5", +"1", "", "2022-06-04T09:00", "3", "4", "5", +# without treatment +"2", "", "2021-12-03T12:00", "1", "2", "1", +"2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", +"2", "2021-12-06T18:00", "", "1", "2", "3" +) \%>\% + mutate( + ASTDTM = ymd_hm(ASTDTM), + AENDTM = ymd_hm(AENDTM), + TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")), + TRTEDTM = if_else(USUBJID == "1", ymd_hm("2022-04-30T23:59"), ymd_hms("")) + ) + +# derive TRTEMFL taking treatment end and worsening into account within a grouping variable +derive_var_trtemfl( + adae2, + new_var = TRTEMFL, + trt_end_date = TRTEDTM, + end_window = 10, + initial_intensity = AEITOXGR, + intensity = AETOXGR, + group_var = AEGRPID +) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, AEGRPID, TRTEMFL) } \seealso{ OCCDS Functions: diff --git a/tests/testthat/test-derive_var_trtemfl.R b/tests/testthat/test-derive_var_trtemfl.R index d16d4708ee..03b3bbe2fb 100644 --- a/tests/testthat/test-derive_var_trtemfl.R +++ b/tests/testthat/test-derive_var_trtemfl.R @@ -34,6 +34,42 @@ expected <- tibble::tribble( adae <- select(expected, -starts_with("TRTEM")) +expected2 <- tribble( + ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, ~TRTEMFL, + # before treatment + "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", NA, + "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", NA, + # starting before treatment and ending during treatment + "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", NA, + "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", "Y", + "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", "Y", + # starting during treatment + "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", "Y", + + # after treatment + "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", "Y", + "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", NA, + # missing dates + "1", "", "", "3", "4", "5", "Y", + "1", "2021-12-30T09:00", "", "3", "4", "5", NA, + "1", "2021-12-30T11:00", "", "3", "3", "5", NA, + "1", "", "2022-01-04T09:00", "3", "4", "5", "Y", + "1", "", "2021-12-24T19:00", "3", "4", "5", NA, + "1", "", "2022-06-04T09:00", "3", "4", "5", "Y", + # without treatment + "2", "", "2021-12-03T12:00", "1", "2", "1", NA, + "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", NA, + "2", "2021-12-06T18:00", "", "1", "2", "3", NA +) %>% + mutate( + ASTDTM = lubridate::ymd_hm(ASTDTM), + AENDTM = lubridate::ymd_hm(AENDTM), + TRTSDTM = if_else(USUBJID == "1", lubridate::ymd_hm("2022-01-01T01:01"), ymd_hms("")), + TRTEDTM = if_else(USUBJID == "1", lubridate::ymd_hm("2022-04-30T23:59"), ymd_hms("")) + ) + +adae2 <- select(expected2, -starts_with("TRTEM")) + ## Test 1: end_window and worsening parameters not specfied ---- test_that("derive_var_trtemfl Test 1: end_window and worsening parameters not specfied", { expect_dfs_equal( @@ -59,8 +95,26 @@ test_that("derive_var_trtemfl Test 2: with end_window and worsening", { ) }) -## Test 3: considering trt end time ---- -test_that("derive_var_trtemfl Test 3: considering trt end time", { +## Test 3: with end_window and worsening within grouping variable---- +test_that("derive_var_trtemfl Test 3: with end_window and worsening within grouping variable", { + expect_dfs_equal( + base = expected2, + comp = derive_var_trtemfl( + adae2, + new_var = TRTEMFL, + trt_end_date = TRTEDTM, + end_window = 10, + initial_intensity = AEITOXGR, + intensity = AETOXGR, + group_var = AEGRPID + ), + keys = c("USUBJID", "ASTDTM", "AENDTM") + ) +}) + + +## Test 4: considering trt end time ---- +test_that("derive_var_trtemfl Test 4: considering trt end time", { expect_dfs_equal( base = select(expected, -TRTEMFL, -TRTEM2FL), comp = derive_var_trtemfl( @@ -76,8 +130,8 @@ test_that("derive_var_trtemfl Test 3: considering trt end time", { ) }) -## Test 4: error if `end_window` without `trt_end_date` ---- -test_that("derive_var_trtemfl Test 4: error if `end_window` without `trt_end_date`", { +## Test 5: error if `end_window` without `trt_end_date` ---- +test_that("derive_var_trtemfl Test 5: error if `end_window` without `trt_end_date`", { expect_error( derive_var_trtemfl( adae, @@ -92,8 +146,8 @@ test_that("derive_var_trtemfl Test 4: error if `end_window` without `trt_end_dat ) }) -## Test 5: error if `initial_intensity` without `intensity` ---- -test_that("derive_var_trtemfl Test 5: error if `initial_intensity` without `intensity`", { +## Test 6: error if `initial_intensity` without `intensity` ---- +test_that("derive_var_trtemfl Test 6: error if `initial_intensity` without `intensity`", { expect_error( derive_var_trtemfl( adae, @@ -108,9 +162,9 @@ test_that("derive_var_trtemfl Test 5: error if `initial_intensity` without `inte ) }) -## Test 6: error if `intensity` without `initial_intensity` ---- -test_that("derive_var_trtemfl Test 6: error if `intensity` without `initial_intensity`", { - expect_error( +## Test 7: error if `intensity` without `initial_intensity` ---- +test_that("derive_var_trtemfl Test 7: error if `intensity` without `initial_intensity`", { + expect_error( derive_var_trtemfl( adae, intensity = AETOXGR @@ -120,6 +174,8 @@ test_that("derive_var_trtemfl Test 6: error if `intensity` without `initial_inte "Either both or none of them must be specified.", sep = "\n" ), - fixed = TRUE + fixed = TRUE ) }) + + From 0e43eef02b03c05a52cbd4f6ae318330f575a731 Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Wed, 6 Mar 2024 19:25:39 +0530 Subject: [PATCH 02/19] #2302 Fixed spelcheck and styler error --- NEWS.md | 2 +- R/derive_var_trtemfl.R | 82 ++++++++++++------------ tests/testthat/test-derive_var_trtemfl.R | 42 ++++++------ 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/NEWS.md b/NEWS.md index 77f17cca16..8a65231951 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,7 +5,7 @@ ## Updates of Existing Functions - Created three unit tests for `get_summary_records()`. (#2304) -- `group_var` (optional) argument is added to `derive_var_trtemfl()` to derive TRTEMFL for AE data if the data are collected as one episode of AE with multiple lines. (#2302) +- `group_var` (optional) parameter is added to `derive_var_trtemfl()` to derive `TRTEMFL` for AE data if the data are collected as one episode of AE with multiple lines. (#2302) ## Breaking Changes diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index b879c3b51f..1ba0b06cc7 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -166,31 +166,31 @@ #' ) %>% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) #' #' adae2 <- expected2 <- tribble( -#' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, -#' # before treatment -#' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", -#' "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", -#' # starting before treatment and ending during treatment -#' "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", -#' "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", -#' "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", -#' # starting during treatment -#' "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", -#' -#' # after treatment -#' "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", -#' "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", -#' # missing dates -#' "1", "", "", "3", "4", "5", -#' "1", "2021-12-30T09:00", "", "3", "4", "5", -#' "1", "2021-12-30T11:00", "", "3", "3", "5", -#' "1", "", "2022-01-04T09:00", "3", "4", "5", -#' "1", "", "2021-12-24T19:00", "3", "4", "5", -#' "1", "", "2022-06-04T09:00", "3", "4", "5", -#' # without treatment -#' "2", "", "2021-12-03T12:00", "1", "2", "1", -#' "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", -#' "2", "2021-12-06T18:00", "", "1", "2", "3" +#' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, +#' # before treatment +#' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", +#' "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", +#' # starting before treatment and ending during treatment +#' "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", +#' "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", +#' "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", +#' # starting during treatment +#' "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", +#' +#' # after treatment +#' "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", +#' "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", +#' # missing dates +#' "1", "", "", "3", "4", "5", +#' "1", "2021-12-30T09:00", "", "3", "4", "5", +#' "1", "2021-12-30T11:00", "", "3", "3", "5", +#' "1", "", "2022-01-04T09:00", "3", "4", "5", +#' "1", "", "2021-12-24T19:00", "3", "4", "5", +#' "1", "", "2022-06-04T09:00", "3", "4", "5", +#' # without treatment +#' "2", "", "2021-12-03T12:00", "1", "2", "1", +#' "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", +#' "2", "2021-12-06T18:00", "", "1", "2", "3" #' ) %>% #' mutate( #' ASTDTM = ymd_hm(ASTDTM), @@ -252,12 +252,14 @@ derive_var_trtemfl <- function(dataset, # Assert required variables required_vars <- - expr_c(start_date, - end_date, - trt_start_date, - trt_end_date, - initial_intensity, - intensity) + expr_c( + start_date, + end_date, + trt_start_date, + trt_end_date, + initial_intensity, + intensity + ) if (!is.null(group_var)) { required_vars <- c(required_vars, enexpr(group_var)) } @@ -293,7 +295,7 @@ derive_var_trtemfl <- function(dataset, } else { end_cond <- expr(is.na(!!trt_end_date) | - !!start_date <= !!trt_end_date + days(end_window)) + !!start_date <= !!trt_end_date + days(end_window)) } } @@ -320,14 +322,14 @@ derive_var_trtemfl <- function(dataset, # Compute TEAE flag based on the presence of multiple records if (multiple_records) { - #Step 1: Identify worsened records after TRTSDT - #Step 2: Get the first worsen date after TRTSDT + # Step 1: Identify worsened records after TRTSDT + # Step 2: Get the first worsen date after TRTSDT dataset <- dataset %>% arrange(USUBJID, !!group_var, !!start_date) %>% group_by(USUBJID, !!group_var) %>% mutate(worsen_date = case_when( start_date >= trt_start_date & - (!!intensity > !is.na(!!initial_intensity)) ~ as_datetime(!!start_date), + (!!intensity > !is.na(!!initial_intensity)) ~ as_datetime(!!start_date), TRUE ~ NA )) %>% ungroup() %>% @@ -349,7 +351,7 @@ derive_var_trtemfl <- function(dataset, ) } dataset <- - select(dataset,-c("first_worsen_date", "worsen_date")) + select(dataset, -c("first_worsen_date", "worsen_date")) } else { if (is.null(intensity)) { worsening_cond <- expr(FALSE) @@ -370,10 +372,10 @@ derive_var_trtemfl <- function(dataset, dataset %>% mutate( !!new_var := case_when( - is.na(!!trt_start_date) ~ NA_character_,!!end_date < !!trt_start_date ~ NA_character_, - is.na(!!start_date) ~ "Y",!!start_date >= !!trt_start_date & - !!end_cond ~ "Y",!!worsening_cond ~ "Y" + is.na(!!trt_start_date) ~ NA_character_, !!end_date < !!trt_start_date ~ NA_character_, + is.na(!!start_date) ~ "Y", !!start_date >= !!trt_start_date & + !!end_cond ~ "Y", !!worsening_cond ~ "Y" ) ) %>% - ungroup() # Remove grouping for consistent behavior + ungroup() # Remove grouping for consistent behavior } diff --git a/tests/testthat/test-derive_var_trtemfl.R b/tests/testthat/test-derive_var_trtemfl.R index 03b3bbe2fb..bd8cf16212 100644 --- a/tests/testthat/test-derive_var_trtemfl.R +++ b/tests/testthat/test-derive_var_trtemfl.R @@ -35,31 +35,31 @@ expected <- tibble::tribble( adae <- select(expected, -starts_with("TRTEM")) expected2 <- tribble( - ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, ~TRTEMFL, + ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, ~TRTEMFL, # before treatment - "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", NA, - "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", NA, + "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", NA, + "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", NA, # starting before treatment and ending during treatment - "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", NA, - "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", "Y", - "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", "Y", + "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", NA, + "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", "Y", + "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", "Y", # starting during treatment - "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", "Y", + "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", "Y", # after treatment - "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", "Y", - "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", NA, + "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", "Y", + "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", NA, # missing dates - "1", "", "", "3", "4", "5", "Y", - "1", "2021-12-30T09:00", "", "3", "4", "5", NA, - "1", "2021-12-30T11:00", "", "3", "3", "5", NA, - "1", "", "2022-01-04T09:00", "3", "4", "5", "Y", - "1", "", "2021-12-24T19:00", "3", "4", "5", NA, - "1", "", "2022-06-04T09:00", "3", "4", "5", "Y", + "1", "", "", "3", "4", "5", "Y", + "1", "2021-12-30T09:00", "", "3", "4", "5", NA, + "1", "2021-12-30T11:00", "", "3", "3", "5", NA, + "1", "", "2022-01-04T09:00", "3", "4", "5", "Y", + "1", "", "2021-12-24T19:00", "3", "4", "5", NA, + "1", "", "2022-06-04T09:00", "3", "4", "5", "Y", # without treatment - "2", "", "2021-12-03T12:00", "1", "2", "1", NA, - "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", NA, - "2", "2021-12-06T18:00", "", "1", "2", "3", NA + "2", "", "2021-12-03T12:00", "1", "2", "1", NA, + "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", NA, + "2", "2021-12-06T18:00", "", "1", "2", "3", NA ) %>% mutate( ASTDTM = lubridate::ymd_hm(ASTDTM), @@ -164,7 +164,7 @@ test_that("derive_var_trtemfl Test 6: error if `initial_intensity` without `inte ## Test 7: error if `intensity` without `initial_intensity` ---- test_that("derive_var_trtemfl Test 7: error if `intensity` without `initial_intensity`", { - expect_error( + expect_error( derive_var_trtemfl( adae, intensity = AETOXGR @@ -174,8 +174,6 @@ test_that("derive_var_trtemfl Test 7: error if `intensity` without `initial_inte "Either both or none of them must be specified.", sep = "\n" ), - fixed = TRUE + fixed = TRUE ) }) - - From 3b29697c910329bada626aaa9cdeeb665be7c78d Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Wed, 6 Mar 2024 21:50:27 +0530 Subject: [PATCH 03/19] #2302 Fixed lintr and roxygen related issues --- R/derive_var_trtemfl.R | 2 +- man/derive_var_trtemfl.Rd | 50 +++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 1ba0b06cc7..1da5b7c78c 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -295,7 +295,7 @@ derive_var_trtemfl <- function(dataset, } else { end_cond <- expr(is.na(!!trt_end_date) | - !!start_date <= !!trt_end_date + days(end_window)) + !!start_date <= !!trt_end_date + days(end_window)) } } diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index 776ec21aec..188019d363 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -184,31 +184,31 @@ derive_var_trtemfl( ) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) adae2 <- expected2 <- tribble( -~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, -# before treatment -"1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", -"1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", -# starting before treatment and ending during treatment -"1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", -"1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", -"1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", -# starting during treatment -"1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", - -# after treatment -"1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", -"1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", -# missing dates -"1", "", "", "3", "4", "5", -"1", "2021-12-30T09:00", "", "3", "4", "5", -"1", "2021-12-30T11:00", "", "3", "3", "5", -"1", "", "2022-01-04T09:00", "3", "4", "5", -"1", "", "2021-12-24T19:00", "3", "4", "5", -"1", "", "2022-06-04T09:00", "3", "4", "5", -# without treatment -"2", "", "2021-12-03T12:00", "1", "2", "1", -"2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", -"2", "2021-12-06T18:00", "", "1", "2", "3" + ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, + # before treatment + "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", + "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", + # starting before treatment and ending during treatment + "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", + "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", + "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", + # starting during treatment + "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", + + # after treatment + "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", + "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", + # missing dates + "1", "", "", "3", "4", "5", + "1", "2021-12-30T09:00", "", "3", "4", "5", + "1", "2021-12-30T11:00", "", "3", "3", "5", + "1", "", "2022-01-04T09:00", "3", "4", "5", + "1", "", "2021-12-24T19:00", "3", "4", "5", + "1", "", "2022-06-04T09:00", "3", "4", "5", + # without treatment + "2", "", "2021-12-03T12:00", "1", "2", "1", + "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", + "2", "2021-12-06T18:00", "", "1", "2", "3" ) \%>\% mutate( ASTDTM = ymd_hm(ASTDTM), From d08c5eed2c8122cb5eee8b387fb77f8463078b22 Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Thu, 7 Mar 2024 11:02:45 +0530 Subject: [PATCH 04/19] #2302 Fixed styler issue --- R/derive_var_trtemfl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 1da5b7c78c..1ba0b06cc7 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -295,7 +295,7 @@ derive_var_trtemfl <- function(dataset, } else { end_cond <- expr(is.na(!!trt_end_date) | - !!start_date <= !!trt_end_date + days(end_window)) + !!start_date <= !!trt_end_date + days(end_window)) } } From 1ad6c836ab0b4fc84420eeb3d6cd61c118dd8a84 Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Fri, 24 May 2024 14:27:27 +0530 Subject: [PATCH 05/19] #2302 Updated new global variables, added `lag()` in NAMESPACE --- NAMESPACE | 3 +-- R/globals.R | 3 ++- man/derive_var_trtemfl.Rd | 57 +++++++++++++++++++-------------------- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index f6e150debb..90a9e27b96 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -155,7 +155,6 @@ export(yn_to_numeric) import(admiraldev) importFrom(cli,ansi_collapse) importFrom(cli,cli_abort) -importFrom(cli,cli_div) importFrom(cli,cli_inform) importFrom(cli,cli_text) importFrom(cli,cli_warn) @@ -175,6 +174,7 @@ importFrom(dplyr,full_join) importFrom(dplyr,group_by) importFrom(dplyr,group_by_at) importFrom(dplyr,if_else) +importFrom(dplyr,lag) importFrom(dplyr,mutate) importFrom(dplyr,n) importFrom(dplyr,n_distinct) @@ -273,7 +273,6 @@ importFrom(rlang,sym) importFrom(rlang,syms) importFrom(rlang,type_of) importFrom(rlang,warn) -importFrom(stats,lag) importFrom(stats,setNames) importFrom(stringr,str_c) importFrom(stringr,str_count) diff --git a/R/globals.R b/R/globals.R index e3bcc0842f..8fac974028 100644 --- a/R/globals.R +++ b/R/globals.R @@ -132,5 +132,6 @@ globalVariables(c( "tmp_col_type", "num_records", "worsen_date", - "first_worsen_date" + "lag_", + "srfl" )) diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index 188019d363..73333583a7 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -184,39 +184,38 @@ derive_var_trtemfl( ) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) adae2 <- expected2 <- tribble( - ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, - # before treatment - "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", - "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", - # starting before treatment and ending during treatment - "1", "2021-12-30T20:00", "2022-01-14T11:00", "2", "2", "2", - "1", "2022-01-05T20:15", "2022-06-01T01:23", "2", "3", "2", - "1", "2022-01-10T20:15", "2022-03-01T01:23", "2", "1", "2", - # starting during treatment - "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", - - # after treatment - "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", - "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", - # missing dates - "1", "", "", "3", "4", "5", - "1", "2021-12-30T09:00", "", "3", "4", "5", - "1", "2021-12-30T11:00", "", "3", "3", "5", - "1", "", "2022-01-04T09:00", "3", "4", "5", - "1", "", "2021-12-24T19:00", "3", "4", "5", - "1", "", "2022-06-04T09:00", "3", "4", "5", - # without treatment - "2", "", "2021-12-03T12:00", "1", "2", "1", - "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", - "2", "2021-12-06T18:00", "", "1", "2", "3" +~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, + # before treatment +"1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", +"1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", +"1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", +"1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", +"1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", +"1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", +# starting during treatment +"1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", +# after treatment +"1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", +"1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", +"1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", +# missing dates +"1", "", "", "3", "4", "5", +"1", "2021-12-30T09:00", "", "3", "4", "5", +"1", "2021-12-30T11:00", "", "3", "3", "5", +"1", "", "2022-01-04T09:00", "3", "4", "5", +"1", "", "2021-12-24T19:00", "3", "4", "5", +"1", "", "2022-06-04T09:00", "3", "4", "5", +# without treatment +"2", "", "2021-12-03T12:00", "1", "2", "1", +"2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", +"2", "2021-12-06T18:00", "", "1", "2", "3" ) \%>\% mutate( ASTDTM = ymd_hm(ASTDTM), AENDTM = ymd_hm(AENDTM), - TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")), - TRTEDTM = if_else(USUBJID == "1", ymd_hm("2022-04-30T23:59"), ymd_hms("")) - ) - + TRTSDTM = if_else(USUBJID != "2", ymd_hm("2022-01-01T01:01"), ymd_hms("")), + TRTEDTM = if_else(USUBJID != "2", ymd_hm("2022-04-30T23:59"), ymd_hms("")) + ) # derive TRTEMFL taking treatment end and worsening into account within a grouping variable derive_var_trtemfl( adae2, From df1afb10e0dccd4102ed6a29cebeb81b5cc8a13a Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Fri, 24 May 2024 15:14:57 +0530 Subject: [PATCH 06/19] #2302 Fixed lintr and styler issue --- R/derive_var_trtemfl.R | 106 ++++++++++++----------- tests/testthat/test-derive_var_trtemfl.R | 40 ++++----- 2 files changed, 74 insertions(+), 72 deletions(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index d984f78ba9..a1bd8aa3c7 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -166,40 +166,40 @@ #' ) %>% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) #' #' adae2 <- expected2 <- tribble( -#' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, -#' # before treatment -#' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", -#' "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", -# starting before treatment and ending during treatment -#' "1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", -#' "1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", -#' "1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", -#' "1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", -#' # starting during treatment -#' "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", - -#' # after treatment -#' "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", -#' "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", -#' "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", -#' # missing dates -#' "1", "", "", "3", "4", "5", -#' "1", "2021-12-30T09:00", "", "3", "4", "5", -#' "1", "2021-12-30T11:00", "", "3", "3", "5", -#' "1", "", "2022-01-04T09:00", "3", "4", "5", -#' "1", "", "2021-12-24T19:00", "3", "4", "5", -#' "1", "", "2022-06-04T09:00", "3", "4", "5", -#' # without treatment -#' "2", "", "2021-12-03T12:00", "1", "2", "1", -#' "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", -#' "2", "2021-12-06T18:00", "", "1", "2", "3" +#' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, +#' # before treatment +#' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", +#' "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", +#' # starting before treatment and ending during treatment +#' "1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", +#' "1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", +#' "1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", +#' "1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", +#' # starting during treatment +#' "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", +#' +#' # after treatment +#' "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", +#' "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", +#' "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", +#' # missing dates +#' "1", "", "", "3", "4", "5", +#' "1", "2021-12-30T09:00", "", "3", "4", "5", +#' "1", "2021-12-30T11:00", "", "3", "3", "5", +#' "1", "", "2022-01-04T09:00", "3", "4", "5", +#' "1", "", "2021-12-24T19:00", "3", "4", "5", +#' "1", "", "2022-06-04T09:00", "3", "4", "5", +#' # without treatment +#' "2", "", "2021-12-03T12:00", "1", "2", "1", +#' "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", +#' "2", "2021-12-06T18:00", "", "1", "2", "3" #' ) %>% #' mutate( #' ASTDTM = ymd_hm(ASTDTM), #' AENDTM = ymd_hm(AENDTM), #' TRTSDTM = if_else(USUBJID != "2", ymd_hm("2022-01-01T01:01"), ymd_hms("")), #' TRTEDTM = if_else(USUBJID != "2", ymd_hm("2022-04-30T23:59"), ymd_hms("")) -#' ) +#' ) #' # derive TRTEMFL taking treatment end and worsening into account within a grouping variable #' derive_var_trtemfl( @@ -253,12 +253,14 @@ derive_var_trtemfl <- function(dataset, # Assert required variables required_vars <- - expr_c(start_date, - end_date, - trt_start_date, - trt_end_date, - initial_intensity, - intensity) + expr_c( + start_date, + end_date, + trt_start_date, + trt_end_date, + initial_intensity, + intensity + ) if (!is.null(group_var)) { required_vars <- c(required_vars, enexpr(group_var)) } @@ -285,13 +287,14 @@ derive_var_trtemfl <- function(dataset, if (ignore_time_for_trt_end) { end_cond <- expr( (is.na(!!trt_end_date) | - date(!!start_date) <= date(!!trt_end_date) + days(end_window)) + date(!!start_date) <= date(!!trt_end_date) + days(end_window)) ) } else { end_cond <- expr( (is.na(!!trt_end_date) | - !!start_date <= !!trt_end_date + days(end_window))) + !!start_date <= !!trt_end_date + days(end_window)) + ) } } @@ -300,8 +303,7 @@ derive_var_trtemfl <- function(dataset, if (is.null(group_var)) { dataset <- dataset %>% mutate(srfl = "Y") - } - else{ + } else { dataset <- dataset %>% group_by(USUBJID, !!group_var) %>% mutate(srfl = ifelse(row_number() == 1, "Y", NA)) %>% @@ -311,25 +313,26 @@ derive_var_trtemfl <- function(dataset, if (is.null(intensity)) { worsening_cond <- expr(FALSE) } else { - if (is.null(group_var)){ + if (is.null(group_var)) { worsening_cond <- - expr(!!start_date < !!trt_start_date & - (!!initial_intensity < !!intensity | is.na(!!initial_intensity) | is.na(!!intensity))) - } - else{ - + expr( + !!start_date < !!trt_start_date & + (!!initial_intensity < !!intensity | is.na(!!initial_intensity) | + is.na(!!intensity)) + ) + } else { dataset <- dataset %>% - arrange(USUBJID,!!group_var,!!start_date) %>% - group_by(USUBJID,!!group_var) %>% + arrange(USUBJID, !!group_var, !!start_date) %>% + group_by(USUBJID, !!group_var) %>% mutate( lag_ = dplyr::lag(!!intensity), worsen_date = case_when( !is.na(!!start_date) & !is.na(!!trt_start_date) & !is.na(lag_) & !!start_date >= !!trt_start_date & - (!!intensity > lag_) ~ !!start_date, - TRUE ~ NA) - + (!!intensity > lag_) ~ !!start_date, + TRUE ~ NA + ) ) %>% fill(worsen_date, .direction = "down") %>% ungroup() @@ -340,14 +343,14 @@ derive_var_trtemfl <- function(dataset, # Derive TRTEMFL based on conditions - dataset <-dataset %>% + dataset <- dataset %>% mutate( !!new_var := case_when( is.na(!!trt_start_date) ~ NA_character_, !!end_date < !!trt_start_date ~ NA_character_, is.na(!!start_date) ~ "Y", !!start_date >= !!trt_start_date & !!end_cond & srfl == "Y" ~ "Y", - !!worsening_cond ~ "Y" + !!worsening_cond ~ "Y" ) ) @@ -358,5 +361,4 @@ derive_var_trtemfl <- function(dataset, } else { dataset <- dataset %>% select(-srfl) } - } diff --git a/tests/testthat/test-derive_var_trtemfl.R b/tests/testthat/test-derive_var_trtemfl.R index 396df1c7dc..7d89b57a69 100644 --- a/tests/testthat/test-derive_var_trtemfl.R +++ b/tests/testthat/test-derive_var_trtemfl.R @@ -35,33 +35,33 @@ expected <- tibble::tribble( adae <- select(expected, -starts_with("TRTEM")) expected2 <- tribble( - ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, ~TRTEMFL, ~TRTEM2FL, + ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, ~TRTEMFL, ~TRTEM2FL, # before treatment - "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", NA, NA, - "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", NA, NA, + "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", NA, NA, + "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", NA, NA, # starting before treatment and ending during treatment - "1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", NA, NA, - "1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", NA, NA, - "1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", "Y", "Y", - "1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", "Y", "Y", + "1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", NA, NA, + "1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", NA, NA, + "1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", "Y", "Y", + "1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", "Y", "Y", # starting during treatment - "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", "Y", "Y", + "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", "Y", "Y", # after treatment - "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", "Y", "Y", - "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", NA, NA, - "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", NA, NA, + "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", "Y", "Y", + "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", NA, NA, + "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", NA, NA, # missing dates - "1", "", "", "3", "4", "5", "Y", "Y", - "1", "2021-12-30T09:00", "", "3", "4", "5", NA, NA, - "1", "2021-12-30T11:00", "", "3", "3", "5", NA, NA, - "1", "", "2022-01-04T09:00", "3", "4", "5", "Y", "Y", - "1", "", "2021-12-24T19:00", "3", "4", "5", NA, NA, - "1", "", "2022-06-04T09:00", "3", "4", "5", "Y", "Y", + "1", "", "", "3", "4", "5", "Y", "Y", + "1", "2021-12-30T09:00", "", "3", "4", "5", NA, NA, + "1", "2021-12-30T11:00", "", "3", "3", "5", NA, NA, + "1", "", "2022-01-04T09:00", "3", "4", "5", "Y", "Y", + "1", "", "2021-12-24T19:00", "3", "4", "5", NA, NA, + "1", "", "2022-06-04T09:00", "3", "4", "5", "Y", "Y", # without treatment - "2", "", "2021-12-03T12:00", "1", "2", "1", NA, NA, - "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", NA, NA, - "2", "2021-12-06T18:00", "", "1", "2", "3", NA, NA + "2", "", "2021-12-03T12:00", "1", "2", "1", NA, NA, + "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", NA, NA, + "2", "2021-12-06T18:00", "", "1", "2", "3", NA, NA ) %>% mutate( ASTDTM = lubridate::ymd_hm(ASTDTM), From 500bc90a4ba9f415ac6f00abab8bad7ce5f48abf Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Fri, 24 May 2024 15:22:16 +0530 Subject: [PATCH 07/19] #2302 Fixed issue related to roxygen check --- man/derive_var_trtemfl.Rd | 54 ++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index 73333583a7..cf841d1093 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -184,38 +184,40 @@ derive_var_trtemfl( ) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) adae2 <- expected2 <- tribble( -~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, - # before treatment -"1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", -"1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", -"1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", -"1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", -"1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", -"1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", -# starting during treatment -"1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", -# after treatment -"1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", -"1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", -"1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", -# missing dates -"1", "", "", "3", "4", "5", -"1", "2021-12-30T09:00", "", "3", "4", "5", -"1", "2021-12-30T11:00", "", "3", "3", "5", -"1", "", "2022-01-04T09:00", "3", "4", "5", -"1", "", "2021-12-24T19:00", "3", "4", "5", -"1", "", "2022-06-04T09:00", "3", "4", "5", -# without treatment -"2", "", "2021-12-03T12:00", "1", "2", "1", -"2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", -"2", "2021-12-06T18:00", "", "1", "2", "3" + ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, + # before treatment + "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", + "1", "2021-12-14T20:15", "2021-12-14T22:00", "1", "3", "1", + # starting before treatment and ending during treatment + "1", "2021-12-30T20:15", "2022-01-14T01:23", "3", "3", "2", + "1", "2022-01-05T20:00", "2022-06-01T11:00", "3", "1", "2", + "1", "2022-01-10T20:15", "2022-01-11T01:23", "3", "2", "2", + "1", "2022-01-13T20:15", "2022-03-01T01:23", "3", "1", "2", + # starting during treatment + "1", "2022-01-01T12:00", "2022-01-02T23:25", "4", "4", "3", + + # after treatment + "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", + "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", + "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", + # missing dates + "1", "", "", "3", "4", "5", + "1", "2021-12-30T09:00", "", "3", "4", "5", + "1", "2021-12-30T11:00", "", "3", "3", "5", + "1", "", "2022-01-04T09:00", "3", "4", "5", + "1", "", "2021-12-24T19:00", "3", "4", "5", + "1", "", "2022-06-04T09:00", "3", "4", "5", + # without treatment + "2", "", "2021-12-03T12:00", "1", "2", "1", + "2", "2021-12-01T12:00", "2021-12-03T12:00", "1", "2", "2", + "2", "2021-12-06T18:00", "", "1", "2", "3" ) \%>\% mutate( ASTDTM = ymd_hm(ASTDTM), AENDTM = ymd_hm(AENDTM), TRTSDTM = if_else(USUBJID != "2", ymd_hm("2022-01-01T01:01"), ymd_hms("")), TRTEDTM = if_else(USUBJID != "2", ymd_hm("2022-04-30T23:59"), ymd_hms("")) - ) + ) # derive TRTEMFL taking treatment end and worsening into account within a grouping variable derive_var_trtemfl( adae2, From 574f32ff97ff5a7db584eeccf153f523f1926eae Mon Sep 17 00:00:00 2001 From: Jerry Johnson Date: Mon, 27 May 2024 17:54:59 +0530 Subject: [PATCH 08/19] #2302 header updated with group_var details and temporary variables are created using `get_new_tmp_var()`, other changes updated suggested in the review comment --- NAMESPACE | 1 + R/admiral-package.R | 4 ++-- R/derive_var_trtemfl.R | 36 +++++++++++++++++++++++------------- R/globals.R | 2 +- man/derive_var_trtemfl.Rd | 23 ++++++++++++++--------- 5 files changed, 41 insertions(+), 25 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 90a9e27b96..324e075080 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -155,6 +155,7 @@ export(yn_to_numeric) import(admiraldev) importFrom(cli,ansi_collapse) importFrom(cli,cli_abort) +importFrom(cli,cli_div) importFrom(cli,cli_inform) importFrom(cli,cli_text) importFrom(cli,cli_warn) diff --git a/R/admiral-package.R b/R/admiral-package.R index 9dde702dd6..d0eef66251 100644 --- a/R/admiral-package.R +++ b/R/admiral-package.R @@ -6,7 +6,7 @@ #' everything filter full_join group_by if_else mutate n pull rename #' rename_with row_number select slice semi_join starts_with ungroup #' n_distinct union distinct summarise coalesce bind_cols na_if tibble tribble -#' summarise_all group_by_at first +#' summarise_all group_by_at first lag #' @importFrom magrittr %>% #' @importFrom rlang := abort arg_match as_function as_label as_name as_string #' call2 caller_env call_name current_env .data enexpr eval_bare eval_tidy @@ -28,5 +28,5 @@ #' @importFrom hms as_hms #' @importFrom lifecycle deprecate_warn deprecated deprecate_stop #' @importFrom stats setNames -#' @importFrom dplyr lag +#' @importFrom cli cli_abort cli_div "_PACKAGE" diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index a1bd8aa3c7..00cc752c58 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -74,9 +74,10 @@ #' If the argument is specified it assumes that AE are recorded as one episode #' of AE with multiple lines using a grouping variable. #' -#' If the argument is specified, events which start before treatment start and -#' end after treatment start (or are ongoing) and worsened (i.e., the -#' intensity is greater than the initial intensity), are flagged. +#' If the argument is specified, events which started during the treatment period +#' irrespective of worsening condition or events which start before treatment start +#' and end after treatment start (or are ongoing) and worsened during treatment +#' (i.e., the intensity is greater than the previous intensity), are flagged. #' #' Once an AE record within a grouped AE is flagged, then any subsequent record #' is also flagged regardless of the severity and within the treatment window. @@ -101,10 +102,15 @@ #' if `start_date` is on or after `trt_start_date` and `start_date` is on #' or before `trt_end_date` + `end_window` days, it is set to `"Y"`, #' - *event started before treatment and (possibly) worsened on treatment*: -#' - if `initial_intensity` and `intensity` is specified: if -#' `initial_intensity < intensity` and `start_date` is before -#' `trt_start_date` and `end_date` is on or after `trt_start_date` or -#' `end_date` is `NA`, it is set to `"Y"`. +#' - if `initial_intensity`, `intensity` is specified and `group_var` is not specified: +#' if `initial_intensity < intensity` and `start_date` is before `trt_start_date` +#' and `end_date` is on or after `trt_start_date` or `end_date` is `NA`, it +#' is set to `"Y"`; +#' - if `group_var` is specified: +#' if previous `intensity` < `intensity` and `start_date` is after `trt_start_date` +#' and `end_date` is on or after `trt_start_date` or `end_date` is `NA`, it +#' is set to `"Y"`; +#' #' - Otherwise it is set to `NA_character_`. #' #' @return The input dataset with the variable specified by `new_var` added @@ -197,8 +203,8 @@ #' mutate( #' ASTDTM = ymd_hm(ASTDTM), #' AENDTM = ymd_hm(AENDTM), -#' TRTSDTM = if_else(USUBJID != "2", ymd_hm("2022-01-01T01:01"), ymd_hms("")), -#' TRTEDTM = if_else(USUBJID != "2", ymd_hm("2022-04-30T23:59"), ymd_hms("")) +#' TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")), +#' TRTEDTM = if_else(USUBJID == "1", ymd_hm("2022-04-30T23:59"), ymd_hms("")) #' ) #' # derive TRTEMFL taking treatment end and worsening into account within a grouping variable @@ -304,6 +310,7 @@ derive_var_trtemfl <- function(dataset, dataset <- dataset %>% mutate(srfl = "Y") } else { + srfl <- get_new_tmp_var(dataset) dataset <- dataset %>% group_by(USUBJID, !!group_var) %>% mutate(srfl = ifelse(row_number() == 1, "Y", NA)) %>% @@ -321,16 +328,19 @@ derive_var_trtemfl <- function(dataset, is.na(!!intensity)) ) } else { + prev_intensity <- get_new_tmp_var(dataset) + worsen_date <- get_new_tmp_var(dataset) + dataset <- dataset %>% arrange(USUBJID, !!group_var, !!start_date) %>% group_by(USUBJID, !!group_var) %>% mutate( - lag_ = dplyr::lag(!!intensity), + prev_intensity = dplyr::lag(!!intensity), worsen_date = case_when( - !is.na(!!start_date) & !is.na(!!trt_start_date) & !is.na(lag_) & + !is.na(!!start_date) & !is.na(!!trt_start_date) & !is.na(prev_intensity) & !!start_date >= !!trt_start_date & - (!!intensity > lag_) ~ !!start_date, + (!!intensity > prev_intensity) ~ !!start_date, TRUE ~ NA ) ) %>% @@ -357,7 +367,7 @@ derive_var_trtemfl <- function(dataset, # Remove unwanted variables if ("worsen_date" %in% names(dataset)) { - dataset <- dataset %>% select(-lag_, -worsen_date, -srfl) + dataset <- dataset %>% select(-prev_intensity, -worsen_date, -srfl) } else { dataset <- dataset %>% select(-srfl) } diff --git a/R/globals.R b/R/globals.R index 8fac974028..f37003b299 100644 --- a/R/globals.R +++ b/R/globals.R @@ -132,6 +132,6 @@ globalVariables(c( "tmp_col_type", "num_records", "worsen_date", - "lag_", + "prev_intensity", "srfl" )) diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index cf841d1093..ca9090bcf5 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -87,9 +87,10 @@ or \code{NULL}} If the argument is specified it assumes that AE are recorded as one episode of AE with multiple lines using a grouping variable. -If the argument is specified, events which start before treatment start and -end after treatment start (or are ongoing) and worsened (i.e., the -intensity is greater than the initial intensity), are flagged. +If the argument is specified, events which started during the treatment period +irrespective of worsening condition or events which start before treatment start +and end after treatment start (or are ongoing) and worsened during treatment +(i.e., the intensity is greater than the previous intensity), are flagged. Once an AE record within a grouped AE is flagged, then any subsequent record is also flagged regardless of the severity and within the treatment window. @@ -124,10 +125,14 @@ or before \code{trt_end_date} + \code{end_window} days, it is set to \code{"Y"}, } \item \emph{event started before treatment and (possibly) worsened on treatment}: \itemize{ -\item if \code{initial_intensity} and \code{intensity} is specified: if -\code{initial_intensity < intensity} and \code{start_date} is before -\code{trt_start_date} and \code{end_date} is on or after \code{trt_start_date} or -\code{end_date} is \code{NA}, it is set to \code{"Y"}. +\item if \code{initial_intensity}, \code{intensity} is specified and \code{group_var} is not specified: +if \code{initial_intensity < intensity} and \code{start_date} is before \code{trt_start_date} +and \code{end_date} is on or after \code{trt_start_date} or \code{end_date} is \code{NA}, it +is set to \code{"Y"}; +\item if \code{group_var} is specified: +if previous \code{intensity} < \code{intensity} and \code{start_date} is after \code{trt_start_date} +and \code{end_date} is on or after \code{trt_start_date} or \code{end_date} is \code{NA}, it +is set to \code{"Y"}; } \item Otherwise it is set to \code{NA_character_}. } @@ -215,8 +220,8 @@ adae2 <- expected2 <- tribble( mutate( ASTDTM = ymd_hm(ASTDTM), AENDTM = ymd_hm(AENDTM), - TRTSDTM = if_else(USUBJID != "2", ymd_hm("2022-01-01T01:01"), ymd_hms("")), - TRTEDTM = if_else(USUBJID != "2", ymd_hm("2022-04-30T23:59"), ymd_hms("")) + TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")), + TRTEDTM = if_else(USUBJID == "1", ymd_hm("2022-04-30T23:59"), ymd_hms("")) ) # derive TRTEMFL taking treatment end and worsening into account within a grouping variable derive_var_trtemfl( From ecf5317c11d4b8b86ea0f7c8e1903823c0946f7e Mon Sep 17 00:00:00 2001 From: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> Date: Fri, 31 May 2024 21:11:50 -0400 Subject: [PATCH 09/19] Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> --- R/derive_var_trtemfl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 00cc752c58..fdc3e4c690 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -268,7 +268,7 @@ derive_var_trtemfl <- function(dataset, intensity ) if (!is.null(group_var)) { - required_vars <- c(required_vars, enexpr(group_var)) + required_vars <- c(required_vars, group_var) } assert_data_frame(dataset, required_vars = required_vars) From 5998b3053a9fa822c848da986c51ed855208f3a5 Mon Sep 17 00:00:00 2001 From: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> Date: Fri, 31 May 2024 21:12:04 -0400 Subject: [PATCH 10/19] Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> --- R/derive_var_trtemfl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index fdc3e4c690..c015e601c4 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -335,7 +335,7 @@ derive_var_trtemfl <- function(dataset, arrange(USUBJID, !!group_var, !!start_date) %>% group_by(USUBJID, !!group_var) %>% mutate( - prev_intensity = dplyr::lag(!!intensity), + prev_intensity = lag(!!intensity), worsen_date = case_when( !is.na(!!start_date) & !is.na(!!trt_start_date) & !is.na(prev_intensity) & From f165dfa34923a070f81b029e3f5d811b112b3dbe Mon Sep 17 00:00:00 2001 From: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> Date: Fri, 31 May 2024 21:12:13 -0400 Subject: [PATCH 11/19] Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> --- R/derive_var_trtemfl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index c015e601c4..d4aaa22239 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -171,7 +171,7 @@ #' intensity = AETOXGR #' ) %>% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) #' -#' adae2 <- expected2 <- tribble( +#' adae2 <- tribble( #' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, #' # before treatment #' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", From f3d62c50f64625e9ba43564670f92ab19348e1a8 Mon Sep 17 00:00:00 2001 From: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> Date: Fri, 31 May 2024 21:12:28 -0400 Subject: [PATCH 12/19] Update R/derive_var_trtemfl.R Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> --- R/derive_var_trtemfl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index d4aaa22239..850816abe5 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -71,7 +71,7 @@ #' #' @param group_var Grouping variable #' -#' If the argument is specified it assumes that AE are recorded as one episode +#' If the argument is specified, it assumes that AEs are recorded as one episode #' of AE with multiple lines using a grouping variable. #' #' If the argument is specified, events which started during the treatment period From 4facbe7336ae55cc77a23b5b8dbd43759e700b4c Mon Sep 17 00:00:00 2001 From: Kangjie Zhang Date: Fri, 31 May 2024 18:17:22 -0700 Subject: [PATCH 13/19] #2302: add subject_keys, update check for initial_intensity --- R/derive_var_trtemfl.R | 37 ++++++++++++++------- tests/testthat/_snaps/derive_var_trtemfl.md | 2 +- tests/testthat/test-derive_var_trtemfl.R | 17 +++++++--- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 850816abe5..369fed8114 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -85,6 +85,8 @@ #' *Permitted Values:* A symbol referring to a variable of the input dataset #' or `NULL` #' +#' @inheritParams derive_param_tte +#' #' @details For the derivation of the new variable the following cases are #' considered in this order. The first case which applies, defines the value #' of the variable. @@ -228,7 +230,8 @@ derive_var_trtemfl <- function(dataset, ignore_time_for_trt_end = TRUE, initial_intensity = NULL, intensity = NULL, - group_var = NULL) { + group_var = NULL, + subject_keys = get_admiral_option("subject_keys")[2]) { # Convert inputs to symbols new_var <- assert_symbol(enexpr(new_var)) start_date <- assert_symbol(enexpr(start_date)) @@ -243,18 +246,28 @@ derive_var_trtemfl <- function(dataset, intensity <- assert_symbol(enexpr(intensity), optional = TRUE) group_var <- assert_symbol(enexpr(group_var), optional = TRUE) + # group_var is not specified # Check if both initial_intensity and intensity are provided - if (is.null(initial_intensity) && !is.null(intensity)) { - cli_abort(c( - "{.arg intensity} argument was specified but not {.arg initial_intensity}", - "Either both or none of them must be specified." - )) - } - if (!is.null(initial_intensity) && is.null(intensity)) { - cli_abort(c( - "{.arg initial_intensity} argument was specified but not {.arg intensity}", - "Either both or none of them must be specified." - )) + if (is.null(group_var)) { + if (is.null(initial_intensity) && !is.null(intensity)) { + cli_abort(c( + "{.arg intensity} argument was specified but not {.arg initial_intensity}", + "Either both or none of them must be specified." + )) + } + if (!is.null(initial_intensity) && is.null(intensity)) { + cli_abort(c( + "{.arg initial_intensity} argument was specified but not {.arg intensity}", + "Either both or none of them must be specified." + )) + } + # group_var is specified + } else { + if (!is.null(initial_intensity)) { + cli_warn(c( + "{.arg initial_intensity} argument is ignored when {.arg group_var} is specified" + )) + } } # Assert required variables diff --git a/tests/testthat/_snaps/derive_var_trtemfl.md b/tests/testthat/_snaps/derive_var_trtemfl.md index 19b5abedaa..2c3c488096 100644 --- a/tests/testthat/_snaps/derive_var_trtemfl.md +++ b/tests/testthat/_snaps/derive_var_trtemfl.md @@ -28,7 +28,7 @@ # derive_var_trtemfl Test 9: error if `intensity` without `initial_intensity` Code - derive_var_trtemfl(adae2, intensity = AETOXGR, group_var = AEGRPID) + derive_var_trtemfl(adae2, intensity = AETOXGR) Condition Error in `derive_var_trtemfl()`: ! `intensity` argument was specified but not `initial_intensity` diff --git a/tests/testthat/test-derive_var_trtemfl.R b/tests/testthat/test-derive_var_trtemfl.R index 7d89b57a69..773fd64207 100644 --- a/tests/testthat/test-derive_var_trtemfl.R +++ b/tests/testthat/test-derive_var_trtemfl.R @@ -106,7 +106,6 @@ test_that("derive_var_trtemfl Test 3: with end_window and worsening within group new_var = TRTEMFL, trt_end_date = TRTEDTM, end_window = 10, - initial_intensity = AEITOXGR, intensity = AETOXGR, group_var = AEGRPID ), @@ -142,7 +141,6 @@ test_that("derive_var_trtemfl Test 5: considering trt end time", { trt_end_date = TRTEDTM, end_window = 10, ignore_time_for_trt_end = FALSE, - initial_intensity = AEITOXGR, intensity = AETOXGR, group_var = AEGRPID ), @@ -188,9 +186,20 @@ test_that("derive_var_trtemfl Test 9: error if `intensity` without `initial_inte expect_snapshot( derive_var_trtemfl( adae2, - intensity = AETOXGR, - group_var = AEGRPID + intensity = AETOXGR ), error = TRUE ) }) + +## Test 10: warning if both `initial_intensity` and `group_var` are specified ---- +test_that("derive_var_trtemfl Test 9: error if `intensity` without `initial_intensity`", { + expect_warning( + derive_var_trtemfl( + adae2, + initial_intensity = AETOXGR, + group_var = AEGRPID + ), + "`initial_intensity` argument is ignored when `group_var` is specified" + ) +}) From b83f86603daae9700ec9b2643c7d3642fc717136 Mon Sep 17 00:00:00 2001 From: Kangjie Zhang Date: Fri, 31 May 2024 20:59:45 -0700 Subject: [PATCH 14/19] #2302: update new AE derivation/get_new_tmp_var --- R/derive_var_trtemfl.R | 64 +++++++++++++----------- tests/testthat/test-derive_var_trtemfl.R | 2 +- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 369fed8114..1f8e77bcc4 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -45,9 +45,12 @@ #' #' @param initial_intensity Initial severity/intensity or toxicity #' -#' If the argument is specified, events which start before treatment start and -#' end after treatment start (or are ongoing) and worsened (i.e., the -#' intensity is greater than the initial intensity), are flagged. +#' `initial_intensity` is ignored when `group_var` is specified. +#' +#' If this argument is specified and `group_var` is `NULL`, events which start +#' before treatment start and end after treatment start (or are ongoing) and +#' worsened (i.e., the intensity is greater than the initial intensity), are +#' flagged. #' #' The values of the specified variable must be comparable with the usual #' comparison operators. I.e., if the intensity is greater than the initial @@ -128,7 +131,7 @@ #' library(dplyr, warn.conflicts = FALSE) #' library(lubridate) #' -#' adae <- expected <- tribble( +#' adae <- tribble( #' ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, #' # before treatment #' "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", @@ -261,7 +264,7 @@ derive_var_trtemfl <- function(dataset, "Either both or none of them must be specified." )) } - # group_var is specified + # group_var is specified } else { if (!is.null(initial_intensity)) { cli_warn(c( @@ -318,16 +321,26 @@ derive_var_trtemfl <- function(dataset, } - # Flagging the single records for both single AE collected data and mutiple AE collected data + # new_ae_cond: Y - new AE, N - AE exists before trt_start_date + new_ae_cond <- get_new_tmp_var(dataset) if (is.null(group_var)) { dataset <- dataset %>% - mutate(srfl = "Y") + mutate( + !!new_ae_cond := if_else(!!start_date >= !!trt_start_date, "Y", "N") + ) } else { - srfl <- get_new_tmp_var(dataset) dataset <- dataset %>% - group_by(USUBJID, !!group_var) %>% - mutate(srfl = ifelse(row_number() == 1, "Y", NA)) %>% - ungroup() + derive_vars_merged( + dataset_add = dataset, + by_vars = expr_c(subject_keys, group_var), + order = exprs(!!start_date), + new_vars = exprs(!!new_ae_cond := "N"), + filter_add = !!start_date < !!trt_start_date, + mode = "last" + ) %>% + mutate( + !!new_ae_cond := if_else(is.na(!!new_ae_cond), "Y", "N") + ) } if (is.null(intensity)) { @@ -348,22 +361,23 @@ derive_var_trtemfl <- function(dataset, arrange(USUBJID, !!group_var, !!start_date) %>% group_by(USUBJID, !!group_var) %>% mutate( - prev_intensity = lag(!!intensity), - worsen_date = + !!prev_intensity := lag(!!intensity), + !!worsen_date := case_when( - !is.na(!!start_date) & !is.na(!!trt_start_date) & !is.na(prev_intensity) & + !is.na(!!start_date) & !is.na(!!trt_start_date) & !is.na(!!prev_intensity) & !!start_date >= !!trt_start_date & - (!!intensity > prev_intensity) ~ !!start_date, + (!!intensity > !!prev_intensity) ~ !!start_date, TRUE ~ NA ) ) %>% - fill(worsen_date, .direction = "down") %>% + fill(!!worsen_date, .direction = "down") %>% ungroup() - worsening_cond <- expr(!is.na(worsen_date)) + worsening_cond <- expr(!is.na(!!worsen_date)) } } + # Derive TRTEMFL based on conditions dataset <- dataset %>% @@ -372,16 +386,10 @@ derive_var_trtemfl <- function(dataset, is.na(!!trt_start_date) ~ NA_character_, !!end_date < !!trt_start_date ~ NA_character_, is.na(!!start_date) ~ "Y", - !!start_date >= !!trt_start_date & !!end_cond & srfl == "Y" ~ "Y", - !!worsening_cond ~ "Y" + !!new_ae_cond == "Y" & !!end_cond ~ "Y", # new AE + !!worsening_cond ~ "Y" # worsened AE ) - ) - - # Remove unwanted variables - - if ("worsen_date" %in% names(dataset)) { - dataset <- dataset %>% select(-prev_intensity, -worsen_date, -srfl) - } else { - dataset <- dataset %>% select(-srfl) - } + ) %>% + # Remove temporary variable + remove_tmp_vars() } diff --git a/tests/testthat/test-derive_var_trtemfl.R b/tests/testthat/test-derive_var_trtemfl.R index 773fd64207..c6317e52f9 100644 --- a/tests/testthat/test-derive_var_trtemfl.R +++ b/tests/testthat/test-derive_var_trtemfl.R @@ -49,7 +49,7 @@ expected2 <- tribble( # after treatment "1", "2022-05-10T11:00", "2022-05-10T13:05", "2", "2", "4", "Y", "Y", - "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", NA, NA, + "1", "2022-05-10T12:00", "2022-05-10T13:05", "2", "2", "4", "Y", "Y", "1", "2022-05-11T11:00", "2022-05-11T13:05", "2", "2", "4", NA, NA, # missing dates "1", "", "", "3", "4", "5", "Y", "Y", From b9908a4f4ee680bb499bd04f0f23a36c4276b0c4 Mon Sep 17 00:00:00 2001 From: Kangjie Zhang Date: Fri, 31 May 2024 21:06:28 -0700 Subject: [PATCH 15/19] #2302: devtools::document() --- man/admiral_adlb.Rd | 4 ++-- man/admiral_adsl.Rd | 4 ++-- man/basket_select.Rd | 2 +- man/censor_source.Rd | 2 +- man/compute_age_years.Rd | 6 +++--- man/compute_bmi.Rd | 2 +- man/compute_bsa.Rd | 2 +- man/compute_dtf.Rd | 6 +++--- man/compute_duration.Rd | 6 +++--- man/compute_egfr.Rd | 2 +- man/compute_framingham.Rd | 2 +- man/compute_map.Rd | 2 +- man/compute_qtc.Rd | 2 +- man/compute_rr.Rd | 2 +- man/compute_scale.Rd | 2 +- man/compute_tmf.Rd | 6 +++--- man/convert_date_to_dtm.Rd | 6 +++--- man/convert_dtc_to_dt.Rd | 4 ++-- man/convert_dtc_to_dtm.Rd | 4 ++-- man/date_source.Rd | 2 +- man/derive_basetype_records.Rd | 2 +- man/derive_param_extreme_record.Rd | 2 +- man/derive_var_analysis_ratio.Rd | 2 +- man/derive_var_anrind.Rd | 2 +- man/derive_var_base.Rd | 2 +- man/derive_var_chg.Rd | 2 +- man/derive_var_dthcaus.Rd | 2 +- man/derive_var_extreme_flag.Rd | 2 +- man/derive_var_joined_exist_flag.Rd | 2 +- man/derive_var_merged_ef_msrc.Rd | 2 +- man/derive_var_merged_exist_flag.Rd | 2 +- man/derive_var_merged_summary.Rd | 2 +- man/derive_var_obs_number.Rd | 2 +- man/derive_var_ontrtfl.Rd | 2 +- man/derive_var_pchg.Rd | 2 +- man/derive_var_relative_flag.Rd | 2 +- man/derive_var_shift.Rd | 2 +- man/derive_var_trtdurd.Rd | 4 ++-- man/derive_var_trtemfl.Rd | 22 +++++++++++++++------- man/derive_vars_computed.Rd | 2 +- man/derive_vars_dt.Rd | 2 +- man/derive_vars_dtm.Rd | 2 +- man/derive_vars_dtm_to_dt.Rd | 4 ++-- man/derive_vars_dtm_to_tm.Rd | 4 ++-- man/derive_vars_duration.Rd | 4 ++-- man/derive_vars_dy.Rd | 4 ++-- man/derive_vars_joined.Rd | 2 +- man/derive_vars_transposed.Rd | 4 ++-- man/dt_level.Rd | 4 ++-- man/dthcaus_source.Rd | 2 +- man/dtm_level.Rd | 4 ++-- man/event_joined.Rd | 2 +- man/event_source.Rd | 2 +- man/ex_single.Rd | 4 ++-- man/example_qs.Rd | 4 ++-- man/extract_duplicate_records.Rd | 2 +- man/flag_event.Rd | 2 +- man/format.basket_select.Rd | 2 +- man/get_imputation_target_date.Rd | 4 ++-- man/get_imputation_target_time.Rd | 4 ++-- man/get_partialdatetime.Rd | 4 ++-- man/get_summary_records.Rd | 2 +- man/impute_dtc_dt.Rd | 2 +- man/impute_dtc_dtm.Rd | 2 +- man/query.Rd | 2 +- man/records_source.Rd | 2 +- man/signal_duplicate_records.Rd | 2 +- man/tte_source.Rd | 2 +- man/tte_source_objects.Rd | 2 +- 69 files changed, 110 insertions(+), 102 deletions(-) diff --git a/man/admiral_adlb.Rd b/man/admiral_adlb.Rd index 8c0bed3e8f..c0b8f1c61e 100644 --- a/man/admiral_adlb.Rd +++ b/man/admiral_adlb.Rd @@ -25,8 +25,8 @@ Other datasets: \code{\link{admiral_adsl}}, \code{\link{ex_single}}, \code{\link{example_qs}}, -\code{\link{queries}}, -\code{\link{queries_mh}} +\code{\link{queries_mh}}, +\code{\link{queries}} } \concept{datasets} \keyword{datasets} diff --git a/man/admiral_adsl.Rd b/man/admiral_adsl.Rd index dabde0e714..d0d9cf08ae 100644 --- a/man/admiral_adsl.Rd +++ b/man/admiral_adsl.Rd @@ -21,8 +21,8 @@ Other datasets: \code{\link{admiral_adlb}}, \code{\link{ex_single}}, \code{\link{example_qs}}, -\code{\link{queries}}, -\code{\link{queries_mh}} +\code{\link{queries_mh}}, +\code{\link{queries}} } \concept{datasets} \keyword{datasets} diff --git a/man/basket_select.Rd b/man/basket_select.Rd index df85f550a7..eb52985bcf 100644 --- a/man/basket_select.Rd +++ b/man/basket_select.Rd @@ -41,9 +41,9 @@ Exactly one of \code{name} or \code{id} must be specified. Source Objects: \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/censor_source.Rd b/man/censor_source.Rd index 263ac16d6a..cea32fcd4b 100644 --- a/man/censor_source.Rd +++ b/man/censor_source.Rd @@ -65,9 +65,9 @@ censor_source( Source Objects: \code{\link{basket_select}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/compute_age_years.Rd b/man/compute_age_years.Rd index 0bea5ded8e..6c1d05c440 100644 --- a/man/compute_age_years.Rd +++ b/man/compute_age_years.Rd @@ -51,10 +51,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{convert_dtc_to_dt}()}, +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/compute_bmi.Rd b/man/compute_bmi.Rd index bbe36fdcff..3c9e966d11 100644 --- a/man/compute_bmi.Rd +++ b/man/compute_bmi.Rd @@ -40,8 +40,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_bsa.Rd b/man/compute_bsa.Rd index 86cc48b7ac..ba887a10f9 100644 --- a/man/compute_bsa.Rd +++ b/man/compute_bsa.Rd @@ -70,8 +70,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_dtf.Rd b/man/compute_dtf.Rd index 7050e76535..c304f935c9 100644 --- a/man/compute_dtf.Rd +++ b/man/compute_dtf.Rd @@ -39,10 +39,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{convert_dtc_to_dt}()}, +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/compute_duration.Rd b/man/compute_duration.Rd index ee20335b3a..3a060af1b2 100644 --- a/man/compute_duration.Rd +++ b/man/compute_duration.Rd @@ -184,10 +184,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_dtf}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{convert_dtc_to_dt}()}, +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/compute_egfr.Rd b/man/compute_egfr.Rd index 7495f0b5c1..c7ed591863 100644 --- a/man/compute_egfr.Rd +++ b/man/compute_egfr.Rd @@ -145,8 +145,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_framingham.Rd b/man/compute_framingham.Rd index 017188a58f..cada5fc027 100644 --- a/man/compute_framingham.Rd +++ b/man/compute_framingham.Rd @@ -121,8 +121,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_egfr}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_map.Rd b/man/compute_map.Rd index 4c28ac2a56..59902e7f0c 100644 --- a/man/compute_map.Rd +++ b/man/compute_map.Rd @@ -51,8 +51,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_egfr}()}, \code{\link{compute_framingham}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_qtc.Rd b/man/compute_qtc.Rd index 663c670f00..a484776b47 100644 --- a/man/compute_qtc.Rd +++ b/man/compute_qtc.Rd @@ -53,8 +53,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_egfr}()}, \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_rr.Rd b/man/compute_rr.Rd index 1d151b7bc2..ba98aaba3e 100644 --- a/man/compute_rr.Rd +++ b/man/compute_rr.Rd @@ -35,8 +35,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_scale}()} } \concept{com_bds_findings} diff --git a/man/compute_scale.Rd b/man/compute_scale.Rd index 742fb01e36..3dd95387be 100644 --- a/man/compute_scale.Rd +++ b/man/compute_scale.Rd @@ -87,8 +87,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation}()}, \code{\link{compute_qual_imputation_dec}()}, +\code{\link{compute_qual_imputation}()}, \code{\link{compute_rr}()} } \concept{com_bds_findings} diff --git a/man/compute_tmf.Rd b/man/compute_tmf.Rd index c5a235123d..cd6a322823 100644 --- a/man/compute_tmf.Rd +++ b/man/compute_tmf.Rd @@ -49,10 +49,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_dtf}()}, \code{\link{compute_duration}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{convert_dtc_to_dt}()}, +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/convert_date_to_dtm.Rd b/man/convert_date_to_dtm.Rd index b9b4c03e48..97b601c29f 100644 --- a/man/convert_date_to_dtm.Rd +++ b/man/convert_date_to_dtm.Rd @@ -147,10 +147,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_dtf}()}, \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{convert_dtc_to_dt}()}, +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/convert_dtc_to_dt.Rd b/man/convert_dtc_to_dt.Rd index 4942e3248e..e0ac2c2969 100644 --- a/man/convert_dtc_to_dt.Rd +++ b/man/convert_dtc_to_dt.Rd @@ -117,8 +117,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/convert_dtc_to_dtm.Rd b/man/convert_dtc_to_dtm.Rd index 887dfd72b9..721702e3a7 100644 --- a/man/convert_dtc_to_dtm.Rd +++ b/man/convert_dtc_to_dtm.Rd @@ -142,8 +142,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dt}()}, -\code{\link{impute_dtc_dtm}()} +\code{\link{impute_dtc_dtm}()}, +\code{\link{impute_dtc_dt}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/date_source.Rd b/man/date_source.Rd index a205d05589..087248f011 100644 --- a/man/date_source.Rd +++ b/man/date_source.Rd @@ -58,8 +58,8 @@ death_date <- date_source( Other superseded: \code{\link{derive_param_extreme_record}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dt}()}, \code{\link{derive_var_extreme_dtm}()}, +\code{\link{derive_var_extreme_dt}()}, \code{\link{dthcaus_source}()}, \code{\link{get_summary_records}()} } diff --git a/man/derive_basetype_records.Rd b/man/derive_basetype_records.Rd index fc0a5fefb4..99a5e7ee71 100644 --- a/man/derive_basetype_records.Rd +++ b/man/derive_basetype_records.Rd @@ -101,8 +101,8 @@ count(bds_with_basetype, BASETYPE, name = "Number of Records") BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_param_extreme_record.Rd b/man/derive_param_extreme_record.Rd index d64cc94d98..f90a47fd27 100644 --- a/man/derive_param_extreme_record.Rd +++ b/man/derive_param_extreme_record.Rd @@ -148,8 +148,8 @@ derive_param_extreme_record( Other superseded: \code{\link{date_source}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dt}()}, \code{\link{derive_var_extreme_dtm}()}, +\code{\link{derive_var_extreme_dt}()}, \code{\link{dthcaus_source}()}, \code{\link{get_summary_records}()} } diff --git a/man/derive_var_analysis_ratio.Rd b/man/derive_var_analysis_ratio.Rd index 799d9a0ce2..9a9b2b7786 100644 --- a/man/derive_var_analysis_ratio.Rd +++ b/man/derive_var_analysis_ratio.Rd @@ -71,8 +71,8 @@ data \%>\% BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_anrind.Rd b/man/derive_var_anrind.Rd index 47e6ee54f7..1446f9db21 100644 --- a/man/derive_var_anrind.Rd +++ b/man/derive_var_anrind.Rd @@ -79,8 +79,8 @@ vs \%>\% derive_var_anrind(use_a1hia1lo = FALSE) BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_base.Rd b/man/derive_var_base.Rd index 6f1eae00d9..5d5a093c47 100644 --- a/man/derive_var_base.Rd +++ b/man/derive_var_base.Rd @@ -97,8 +97,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, \code{\link{derive_var_pchg}()}, diff --git a/man/derive_var_chg.Rd b/man/derive_var_chg.Rd index 440d374ac7..8a8df5a60b 100644 --- a/man/derive_var_chg.Rd +++ b/man/derive_var_chg.Rd @@ -37,8 +37,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_ontrtfl}()}, \code{\link{derive_var_pchg}()}, diff --git a/man/derive_var_dthcaus.Rd b/man/derive_var_dthcaus.Rd index 47aa93a425..5cf2117bd3 100644 --- a/man/derive_var_dthcaus.Rd +++ b/man/derive_var_dthcaus.Rd @@ -150,8 +150,8 @@ derive_var_dthcaus( Other superseded: \code{\link{date_source}()}, \code{\link{derive_param_extreme_record}()}, -\code{\link{derive_var_extreme_dt}()}, \code{\link{derive_var_extreme_dtm}()}, +\code{\link{derive_var_extreme_dt}()}, \code{\link{dthcaus_source}()}, \code{\link{get_summary_records}()} } diff --git a/man/derive_var_extreme_flag.Rd b/man/derive_var_extreme_flag.Rd index 7deac86681..08b2b19de5 100644 --- a/man/derive_var_extreme_flag.Rd +++ b/man/derive_var_extreme_flag.Rd @@ -270,8 +270,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_joined_exist_flag.Rd b/man/derive_var_joined_exist_flag.Rd index 68afcaf1d4..fd7f0c3e52 100644 --- a/man/derive_var_joined_exist_flag.Rd +++ b/man/derive_var_joined_exist_flag.Rd @@ -493,8 +493,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_merged_ef_msrc.Rd b/man/derive_var_merged_ef_msrc.Rd index 538921116d..e80a4b046b 100644 --- a/man/derive_var_merged_ef_msrc.Rd +++ b/man/derive_var_merged_ef_msrc.Rd @@ -196,8 +196,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_merged_exist_flag.Rd b/man/derive_var_merged_exist_flag.Rd index 70a3071677..3462ef8143 100644 --- a/man/derive_var_merged_exist_flag.Rd +++ b/man/derive_var_merged_exist_flag.Rd @@ -154,8 +154,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_merged_summary.Rd b/man/derive_var_merged_summary.Rd index fd50515c21..91d22b76e2 100644 --- a/man/derive_var_merged_summary.Rd +++ b/man/derive_var_merged_summary.Rd @@ -187,8 +187,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_obs_number.Rd b/man/derive_var_obs_number.Rd index b727cc7f7d..91866338e7 100644 --- a/man/derive_var_obs_number.Rd +++ b/man/derive_var_obs_number.Rd @@ -105,8 +105,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_ontrtfl.Rd b/man/derive_var_ontrtfl.Rd index a2092e97e8..530c7c42a2 100644 --- a/man/derive_var_ontrtfl.Rd +++ b/man/derive_var_ontrtfl.Rd @@ -197,8 +197,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_pchg}()}, diff --git a/man/derive_var_pchg.Rd b/man/derive_var_pchg.Rd index bb6880d031..70b6749fcb 100644 --- a/man/derive_var_pchg.Rd +++ b/man/derive_var_pchg.Rd @@ -41,8 +41,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_relative_flag.Rd b/man/derive_var_relative_flag.Rd index 4fc22c0565..4f31e91ffe 100644 --- a/man/derive_var_relative_flag.Rd +++ b/man/derive_var_relative_flag.Rd @@ -181,8 +181,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_obs_number}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_shift.Rd b/man/derive_var_shift.Rd index 0a2cea5336..3bdc2b5d07 100644 --- a/man/derive_var_shift.Rd +++ b/man/derive_var_shift.Rd @@ -84,8 +84,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_atoxgr_dir}()}, +\code{\link{derive_var_atoxgr}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_trtdurd.Rd b/man/derive_var_trtdurd.Rd index 19be989dd5..d6de2f71e2 100644 --- a/man/derive_var_trtdurd.Rd +++ b/man/derive_var_trtdurd.Rd @@ -56,10 +56,10 @@ derive_var_trtdurd(data) \code{\link[=derive_vars_duration]{derive_vars_duration()}} Date/Time Derivation Functions that returns variable appended to dataset: -\code{\link{derive_vars_dt}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index ca9090bcf5..8e238a4a71 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -15,7 +15,8 @@ derive_var_trtemfl( ignore_time_for_trt_end = TRUE, initial_intensity = NULL, intensity = NULL, - group_var = NULL + group_var = NULL, + subject_keys = get_admiral_option("subject_keys")[2] ) } \arguments{ @@ -58,9 +59,12 @@ the event occurred more than \code{end_window} days after end of treatment. \item{initial_intensity}{Initial severity/intensity or toxicity -If the argument is specified, events which start before treatment start and -end after treatment start (or are ongoing) and worsened (i.e., the -intensity is greater than the initial intensity), are flagged. +\code{initial_intensity} is ignored when \code{group_var} is specified. + +If this argument is specified and \code{group_var} is \code{NULL}, events which start +before treatment start and end after treatment start (or are ongoing) and +worsened (i.e., the intensity is greater than the initial intensity), are +flagged. The values of the specified variable must be comparable with the usual comparison operators. I.e., if the intensity is greater than the initial @@ -84,7 +88,7 @@ or \code{NULL}} \item{group_var}{Grouping variable -If the argument is specified it assumes that AE are recorded as one episode +If the argument is specified, it assumes that AEs are recorded as one episode of AE with multiple lines using a grouping variable. If the argument is specified, events which started during the treatment period @@ -97,6 +101,10 @@ is also flagged regardless of the severity and within the treatment window. \emph{Permitted Values:} A symbol referring to a variable of the input dataset or \code{NULL}} + +\item{subject_keys}{Variables to uniquely identify a subject + +A list of symbols created using \code{exprs()} is expected.} } \value{ The input dataset with the variable specified by \code{new_var} added @@ -143,7 +151,7 @@ library(tibble) library(dplyr, warn.conflicts = FALSE) library(lubridate) -adae <- expected <- tribble( +adae <- tribble( ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, # before treatment "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", @@ -188,7 +196,7 @@ derive_var_trtemfl( intensity = AETOXGR ) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, TRTEM2FL) -adae2 <- expected2 <- tribble( +adae2 <- tribble( ~USUBJID, ~ASTDTM, ~AENDTM, ~AEITOXGR, ~AETOXGR, ~AEGRPID, # before treatment "1", "2021-12-13T20:15", "2021-12-15T12:45", "1", "1", "1", diff --git a/man/derive_vars_computed.Rd b/man/derive_vars_computed.Rd index 205f804d78..a87343bf6c 100644 --- a/man/derive_vars_computed.Rd +++ b/man/derive_vars_computed.Rd @@ -174,8 +174,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_obs_number}()}, \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_vars_dt.Rd b/man/derive_vars_dt.Rd index 2536eb647a..fdd728fa16 100644 --- a/man/derive_vars_dt.Rd +++ b/man/derive_vars_dt.Rd @@ -235,9 +235,9 @@ derive_vars_dt( \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, +\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_dtm.Rd b/man/derive_vars_dtm.Rd index 702a408d1a..954bef821f 100644 --- a/man/derive_vars_dtm.Rd +++ b/man/derive_vars_dtm.Rd @@ -255,9 +255,9 @@ derive_vars_dtm( \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_dtm_to_dt.Rd b/man/derive_vars_dtm_to_dt.Rd index c059bb62c6..55601eb360 100644 --- a/man/derive_vars_dtm_to_dt.Rd +++ b/man/derive_vars_dtm_to_dt.Rd @@ -47,9 +47,9 @@ adcm \%>\% \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dt}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_tm}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_dtm_to_tm.Rd b/man/derive_vars_dtm_to_tm.Rd index 87642cf247..a3b40c7c73 100644 --- a/man/derive_vars_dtm_to_tm.Rd +++ b/man/derive_vars_dtm_to_tm.Rd @@ -57,9 +57,9 @@ adcm \%>\% \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dt}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_duration.Rd b/man/derive_vars_duration.Rd index bf9b324aba..d40c7edf18 100644 --- a/man/derive_vars_duration.Rd +++ b/man/derive_vars_duration.Rd @@ -234,10 +234,10 @@ derive_vars_duration( Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dt}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_dy}()} } \concept{der_date_time} diff --git a/man/derive_vars_dy.Rd b/man/derive_vars_dy.Rd index 8a3f15964b..3591eca955 100644 --- a/man/derive_vars_dy.Rd +++ b/man/derive_vars_dy.Rd @@ -79,10 +79,10 @@ derive_vars_dy( \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dt}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()} } \concept{der_date_time} diff --git a/man/derive_vars_joined.Rd b/man/derive_vars_joined.Rd index 2730270870..f2595212f0 100644 --- a/man/derive_vars_joined.Rd +++ b/man/derive_vars_joined.Rd @@ -505,8 +505,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_obs_number}()}, \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, -\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_vars_transposed.Rd b/man/derive_vars_transposed.Rd index eb058a5383..891b2e5043 100644 --- a/man/derive_vars_transposed.Rd +++ b/man/derive_vars_transposed.Rd @@ -109,8 +109,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged}()}, -\code{\link{derive_vars_merged_lookup}()} +\code{\link{derive_vars_merged_lookup}()}, +\code{\link{derive_vars_merged}()} } \concept{der_gen} \keyword{der_gen} diff --git a/man/dt_level.Rd b/man/dt_level.Rd index 48631ac7ed..920a162c8a 100644 --- a/man/dt_level.Rd +++ b/man/dt_level.Rd @@ -28,8 +28,8 @@ Utilities used for date imputation: \code{\link{get_imputation_target_date}()}, \code{\link{get_imputation_target_time}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dt}()}, -\code{\link{restrict_imputed_dtc_dtm}()} +\code{\link{restrict_imputed_dtc_dtm}()}, +\code{\link{restrict_imputed_dtc_dt}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/dthcaus_source.Rd b/man/dthcaus_source.Rd index 968cf9c8f4..90c7c7cd98 100644 --- a/man/dthcaus_source.Rd +++ b/man/dthcaus_source.Rd @@ -79,8 +79,8 @@ Other superseded: \code{\link{date_source}()}, \code{\link{derive_param_extreme_record}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dt}()}, \code{\link{derive_var_extreme_dtm}()}, +\code{\link{derive_var_extreme_dt}()}, \code{\link{get_summary_records}()} } \concept{superseded} diff --git a/man/dtm_level.Rd b/man/dtm_level.Rd index b5fa5d88ea..63ebf90389 100644 --- a/man/dtm_level.Rd +++ b/man/dtm_level.Rd @@ -29,8 +29,8 @@ Utilities used for date imputation: \code{\link{get_imputation_target_date}()}, \code{\link{get_imputation_target_time}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dt}()}, -\code{\link{restrict_imputed_dtc_dtm}()} +\code{\link{restrict_imputed_dtc_dtm}()}, +\code{\link{restrict_imputed_dtc_dt}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/event_joined.Rd b/man/event_joined.Rd index c01958b8fd..c14e7a3aa7 100644 --- a/man/event_joined.Rd +++ b/man/event_joined.Rd @@ -285,8 +285,8 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/event_source.Rd b/man/event_source.Rd index 03e7b4913c..75b3321c1d 100644 --- a/man/event_source.Rd +++ b/man/event_source.Rd @@ -56,8 +56,8 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/ex_single.Rd b/man/ex_single.Rd index 5bdcb56823..80d2891a21 100644 --- a/man/ex_single.Rd +++ b/man/ex_single.Rd @@ -21,8 +21,8 @@ Other datasets: \code{\link{admiral_adlb}}, \code{\link{admiral_adsl}}, \code{\link{example_qs}}, -\code{\link{queries}}, -\code{\link{queries_mh}} +\code{\link{queries_mh}}, +\code{\link{queries}} } \concept{datasets} \keyword{datasets} diff --git a/man/example_qs.Rd b/man/example_qs.Rd index 54845ed6e0..10902ebde4 100644 --- a/man/example_qs.Rd +++ b/man/example_qs.Rd @@ -23,8 +23,8 @@ Other datasets: \code{\link{admiral_adlb}}, \code{\link{admiral_adsl}}, \code{\link{ex_single}}, -\code{\link{queries}}, -\code{\link{queries_mh}} +\code{\link{queries_mh}}, +\code{\link{queries}} } \concept{datasets} \keyword{datasets} diff --git a/man/extract_duplicate_records.Rd b/man/extract_duplicate_records.Rd index 816990253c..184fb76205 100644 --- a/man/extract_duplicate_records.Rd +++ b/man/extract_duplicate_records.Rd @@ -34,7 +34,7 @@ extract_duplicate_records(adsl, exprs(USUBJID)) } \seealso{ Other internal: -\code{\link{admiral-package}}, +\code{\link{admiral}}, \code{\link{format.basket_select}()}, \code{\link{signal_duplicate_records}()} } diff --git a/man/flag_event.Rd b/man/flag_event.Rd index 57709e58d5..4790cdd3e5 100644 --- a/man/flag_event.Rd +++ b/man/flag_event.Rd @@ -39,9 +39,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{query}()}, \code{\link{records_source}()}, \code{\link{tte_source}()} diff --git a/man/format.basket_select.Rd b/man/format.basket_select.Rd index c31aafefa0..fa5da5dcc8 100644 --- a/man/format.basket_select.Rd +++ b/man/format.basket_select.Rd @@ -26,7 +26,7 @@ format(basket_select(id = 42, scope = "NARROW", type = "smq")) \code{\link[=basket_select]{basket_select()}} Other internal: -\code{\link{admiral-package}}, +\code{\link{admiral}}, \code{\link{extract_duplicate_records}()}, \code{\link{signal_duplicate_records}()} } diff --git a/man/get_imputation_target_date.Rd b/man/get_imputation_target_date.Rd index 9091fa2cb1..2f8248eae0 100644 --- a/man/get_imputation_target_date.Rd +++ b/man/get_imputation_target_date.Rd @@ -48,8 +48,8 @@ Utilities used for date imputation: \code{\link{dtm_level}()}, \code{\link{get_imputation_target_time}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dt}()}, -\code{\link{restrict_imputed_dtc_dtm}()} +\code{\link{restrict_imputed_dtc_dtm}()}, +\code{\link{restrict_imputed_dtc_dt}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/get_imputation_target_time.Rd b/man/get_imputation_target_time.Rd index fcb7750936..c15c4d2c49 100644 --- a/man/get_imputation_target_time.Rd +++ b/man/get_imputation_target_time.Rd @@ -39,8 +39,8 @@ Utilities used for date imputation: \code{\link{dtm_level}()}, \code{\link{get_imputation_target_date}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dt}()}, -\code{\link{restrict_imputed_dtc_dtm}()} +\code{\link{restrict_imputed_dtc_dtm}()}, +\code{\link{restrict_imputed_dtc_dt}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/get_partialdatetime.Rd b/man/get_partialdatetime.Rd index 1ac459df46..8b4917859c 100644 --- a/man/get_partialdatetime.Rd +++ b/man/get_partialdatetime.Rd @@ -33,8 +33,8 @@ Utilities used for date imputation: \code{\link{dtm_level}()}, \code{\link{get_imputation_target_date}()}, \code{\link{get_imputation_target_time}()}, -\code{\link{restrict_imputed_dtc_dt}()}, -\code{\link{restrict_imputed_dtc_dtm}()} +\code{\link{restrict_imputed_dtc_dtm}()}, +\code{\link{restrict_imputed_dtc_dt}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/get_summary_records.Rd b/man/get_summary_records.Rd index 70e547b534..883c94370d 100644 --- a/man/get_summary_records.Rd +++ b/man/get_summary_records.Rd @@ -176,8 +176,8 @@ Other superseded: \code{\link{date_source}()}, \code{\link{derive_param_extreme_record}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dt}()}, \code{\link{derive_var_extreme_dtm}()}, +\code{\link{derive_var_extreme_dt}()}, \code{\link{dthcaus_source}()} } \concept{superseded} diff --git a/man/impute_dtc_dt.Rd b/man/impute_dtc_dt.Rd index 8cb3dc4f14..2b677165df 100644 --- a/man/impute_dtc_dt.Rd +++ b/man/impute_dtc_dt.Rd @@ -181,8 +181,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, +\code{\link{convert_dtc_to_dt}()}, \code{\link{impute_dtc_dtm}()} } \concept{com_date_time} diff --git a/man/impute_dtc_dtm.Rd b/man/impute_dtc_dtm.Rd index ac97948e01..479c214f3c 100644 --- a/man/impute_dtc_dtm.Rd +++ b/man/impute_dtc_dtm.Rd @@ -223,8 +223,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dt}()}, \code{\link{convert_dtc_to_dtm}()}, +\code{\link{convert_dtc_to_dt}()}, \code{\link{impute_dtc_dt}()} } \concept{com_date_time} diff --git a/man/query.Rd b/man/query.Rd index 61d871ea6f..df454b1996 100644 --- a/man/query.Rd +++ b/man/query.Rd @@ -138,9 +138,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{records_source}()}, \code{\link{tte_source}()} diff --git a/man/records_source.Rd b/man/records_source.Rd index 7f3121a3f6..2b47fab421 100644 --- a/man/records_source.Rd +++ b/man/records_source.Rd @@ -44,9 +44,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{tte_source}()} diff --git a/man/signal_duplicate_records.Rd b/man/signal_duplicate_records.Rd index 076bc3cbaf..3eb0fa14b0 100644 --- a/man/signal_duplicate_records.Rd +++ b/man/signal_duplicate_records.Rd @@ -45,7 +45,7 @@ signal_duplicate_records(adsl, exprs(USUBJID), cnd_type = "message") } \seealso{ Other internal: -\code{\link{admiral-package}}, +\code{\link{admiral}}, \code{\link{extract_duplicate_records}()}, \code{\link{format.basket_select}()} } diff --git a/man/tte_source.Rd b/man/tte_source.Rd index f63a36d51d..612ef672de 100644 --- a/man/tte_source.Rd +++ b/man/tte_source.Rd @@ -44,9 +44,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()} diff --git a/man/tte_source_objects.Rd b/man/tte_source_objects.Rd index 565de0e340..2668d39355 100644 --- a/man/tte_source_objects.Rd +++ b/man/tte_source_objects.Rd @@ -63,9 +63,9 @@ for (obj in list_tte_source_objects()$object) { Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, -\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, +\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, From 68e0bb6056eea39bfba7b00e14aeaa7c1ecf8ec0 Mon Sep 17 00:00:00 2001 From: Kangjie Zhang Date: Fri, 31 May 2024 21:18:54 -0700 Subject: [PATCH 16/19] #2302: upversion roxygen2 --- man/admiral_adlb.Rd | 4 ++-- man/admiral_adsl.Rd | 4 ++-- man/basket_select.Rd | 2 +- man/censor_source.Rd | 2 +- man/compute_age_years.Rd | 6 +++--- man/compute_bmi.Rd | 2 +- man/compute_bsa.Rd | 2 +- man/compute_dtf.Rd | 6 +++--- man/compute_duration.Rd | 6 +++--- man/compute_egfr.Rd | 2 +- man/compute_framingham.Rd | 2 +- man/compute_map.Rd | 2 +- man/compute_qtc.Rd | 2 +- man/compute_rr.Rd | 2 +- man/compute_scale.Rd | 2 +- man/compute_tmf.Rd | 6 +++--- man/convert_date_to_dtm.Rd | 6 +++--- man/convert_dtc_to_dt.Rd | 4 ++-- man/convert_dtc_to_dtm.Rd | 4 ++-- man/date_source.Rd | 2 +- man/derive_basetype_records.Rd | 2 +- man/derive_param_extreme_record.Rd | 2 +- man/derive_var_analysis_ratio.Rd | 2 +- man/derive_var_anrind.Rd | 2 +- man/derive_var_base.Rd | 2 +- man/derive_var_chg.Rd | 2 +- man/derive_var_dthcaus.Rd | 2 +- man/derive_var_extreme_flag.Rd | 2 +- man/derive_var_joined_exist_flag.Rd | 2 +- man/derive_var_merged_ef_msrc.Rd | 2 +- man/derive_var_merged_exist_flag.Rd | 2 +- man/derive_var_merged_summary.Rd | 2 +- man/derive_var_obs_number.Rd | 2 +- man/derive_var_ontrtfl.Rd | 2 +- man/derive_var_pchg.Rd | 2 +- man/derive_var_relative_flag.Rd | 2 +- man/derive_var_shift.Rd | 2 +- man/derive_var_trtdurd.Rd | 4 ++-- man/derive_vars_computed.Rd | 2 +- man/derive_vars_dt.Rd | 2 +- man/derive_vars_dtm.Rd | 2 +- man/derive_vars_dtm_to_dt.Rd | 4 ++-- man/derive_vars_dtm_to_tm.Rd | 4 ++-- man/derive_vars_duration.Rd | 4 ++-- man/derive_vars_dy.Rd | 4 ++-- man/derive_vars_joined.Rd | 2 +- man/derive_vars_transposed.Rd | 4 ++-- man/dt_level.Rd | 4 ++-- man/dthcaus_source.Rd | 2 +- man/dtm_level.Rd | 4 ++-- man/event_joined.Rd | 2 +- man/event_source.Rd | 2 +- man/ex_single.Rd | 4 ++-- man/example_qs.Rd | 4 ++-- man/extract_duplicate_records.Rd | 2 +- man/flag_event.Rd | 2 +- man/format.basket_select.Rd | 2 +- man/get_imputation_target_date.Rd | 4 ++-- man/get_imputation_target_time.Rd | 4 ++-- man/get_partialdatetime.Rd | 4 ++-- man/get_summary_records.Rd | 2 +- man/impute_dtc_dt.Rd | 2 +- man/impute_dtc_dtm.Rd | 2 +- man/query.Rd | 2 +- man/records_source.Rd | 2 +- man/signal_duplicate_records.Rd | 2 +- man/tte_source.Rd | 2 +- man/tte_source_objects.Rd | 2 +- 68 files changed, 95 insertions(+), 95 deletions(-) diff --git a/man/admiral_adlb.Rd b/man/admiral_adlb.Rd index c0b8f1c61e..8c0bed3e8f 100644 --- a/man/admiral_adlb.Rd +++ b/man/admiral_adlb.Rd @@ -25,8 +25,8 @@ Other datasets: \code{\link{admiral_adsl}}, \code{\link{ex_single}}, \code{\link{example_qs}}, -\code{\link{queries_mh}}, -\code{\link{queries}} +\code{\link{queries}}, +\code{\link{queries_mh}} } \concept{datasets} \keyword{datasets} diff --git a/man/admiral_adsl.Rd b/man/admiral_adsl.Rd index d0d9cf08ae..dabde0e714 100644 --- a/man/admiral_adsl.Rd +++ b/man/admiral_adsl.Rd @@ -21,8 +21,8 @@ Other datasets: \code{\link{admiral_adlb}}, \code{\link{ex_single}}, \code{\link{example_qs}}, -\code{\link{queries_mh}}, -\code{\link{queries}} +\code{\link{queries}}, +\code{\link{queries_mh}} } \concept{datasets} \keyword{datasets} diff --git a/man/basket_select.Rd b/man/basket_select.Rd index eb52985bcf..df85f550a7 100644 --- a/man/basket_select.Rd +++ b/man/basket_select.Rd @@ -41,9 +41,9 @@ Exactly one of \code{name} or \code{id} must be specified. Source Objects: \code{\link{censor_source}()}, \code{\link{death_event}}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/censor_source.Rd b/man/censor_source.Rd index cea32fcd4b..263ac16d6a 100644 --- a/man/censor_source.Rd +++ b/man/censor_source.Rd @@ -65,9 +65,9 @@ censor_source( Source Objects: \code{\link{basket_select}()}, \code{\link{death_event}}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/compute_age_years.Rd b/man/compute_age_years.Rd index 6c1d05c440..0bea5ded8e 100644 --- a/man/compute_age_years.Rd +++ b/man/compute_age_years.Rd @@ -51,10 +51,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{convert_dtc_to_dtm}()}, +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/compute_bmi.Rd b/man/compute_bmi.Rd index 3c9e966d11..bbe36fdcff 100644 --- a/man/compute_bmi.Rd +++ b/man/compute_bmi.Rd @@ -40,8 +40,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_bsa.Rd b/man/compute_bsa.Rd index ba887a10f9..86cc48b7ac 100644 --- a/man/compute_bsa.Rd +++ b/man/compute_bsa.Rd @@ -70,8 +70,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_dtf.Rd b/man/compute_dtf.Rd index c304f935c9..7050e76535 100644 --- a/man/compute_dtf.Rd +++ b/man/compute_dtf.Rd @@ -39,10 +39,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{convert_dtc_to_dtm}()}, +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/compute_duration.Rd b/man/compute_duration.Rd index 3a060af1b2..ee20335b3a 100644 --- a/man/compute_duration.Rd +++ b/man/compute_duration.Rd @@ -184,10 +184,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_dtf}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{convert_dtc_to_dtm}()}, +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/compute_egfr.Rd b/man/compute_egfr.Rd index c7ed591863..7495f0b5c1 100644 --- a/man/compute_egfr.Rd +++ b/man/compute_egfr.Rd @@ -145,8 +145,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_framingham.Rd b/man/compute_framingham.Rd index cada5fc027..017188a58f 100644 --- a/man/compute_framingham.Rd +++ b/man/compute_framingham.Rd @@ -121,8 +121,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_egfr}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_map.Rd b/man/compute_map.Rd index 59902e7f0c..4c28ac2a56 100644 --- a/man/compute_map.Rd +++ b/man/compute_map.Rd @@ -51,8 +51,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_egfr}()}, \code{\link{compute_framingham}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_qtc.Rd b/man/compute_qtc.Rd index a484776b47..663c670f00 100644 --- a/man/compute_qtc.Rd +++ b/man/compute_qtc.Rd @@ -53,8 +53,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_egfr}()}, \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()}, \code{\link{compute_scale}()} } diff --git a/man/compute_rr.Rd b/man/compute_rr.Rd index ba98aaba3e..1d151b7bc2 100644 --- a/man/compute_rr.Rd +++ b/man/compute_rr.Rd @@ -35,8 +35,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_scale}()} } \concept{com_bds_findings} diff --git a/man/compute_scale.Rd b/man/compute_scale.Rd index 3dd95387be..742fb01e36 100644 --- a/man/compute_scale.Rd +++ b/man/compute_scale.Rd @@ -87,8 +87,8 @@ BDS-Findings Functions that returns a vector: \code{\link{compute_framingham}()}, \code{\link{compute_map}()}, \code{\link{compute_qtc}()}, -\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_qual_imputation}()}, +\code{\link{compute_qual_imputation_dec}()}, \code{\link{compute_rr}()} } \concept{com_bds_findings} diff --git a/man/compute_tmf.Rd b/man/compute_tmf.Rd index cd6a322823..c5a235123d 100644 --- a/man/compute_tmf.Rd +++ b/man/compute_tmf.Rd @@ -49,10 +49,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_dtf}()}, \code{\link{compute_duration}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{convert_dtc_to_dtm}()}, +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/convert_date_to_dtm.Rd b/man/convert_date_to_dtm.Rd index 97b601c29f..b9b4c03e48 100644 --- a/man/convert_date_to_dtm.Rd +++ b/man/convert_date_to_dtm.Rd @@ -147,10 +147,10 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_dtf}()}, \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{convert_dtc_to_dtm}()}, +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/convert_dtc_to_dt.Rd b/man/convert_dtc_to_dt.Rd index e0ac2c2969..4942e3248e 100644 --- a/man/convert_dtc_to_dt.Rd +++ b/man/convert_dtc_to_dt.Rd @@ -117,8 +117,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, \code{\link{convert_dtc_to_dtm}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/convert_dtc_to_dtm.Rd b/man/convert_dtc_to_dtm.Rd index 721702e3a7..887dfd72b9 100644 --- a/man/convert_dtc_to_dtm.Rd +++ b/man/convert_dtc_to_dtm.Rd @@ -142,8 +142,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, -\code{\link{impute_dtc_dtm}()}, -\code{\link{impute_dtc_dt}()} +\code{\link{impute_dtc_dt}()}, +\code{\link{impute_dtc_dtm}()} } \concept{com_date_time} \keyword{com_date_time} diff --git a/man/date_source.Rd b/man/date_source.Rd index 087248f011..a205d05589 100644 --- a/man/date_source.Rd +++ b/man/date_source.Rd @@ -58,8 +58,8 @@ death_date <- date_source( Other superseded: \code{\link{derive_param_extreme_record}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dtm}()}, \code{\link{derive_var_extreme_dt}()}, +\code{\link{derive_var_extreme_dtm}()}, \code{\link{dthcaus_source}()}, \code{\link{get_summary_records}()} } diff --git a/man/derive_basetype_records.Rd b/man/derive_basetype_records.Rd index 99a5e7ee71..fc0a5fefb4 100644 --- a/man/derive_basetype_records.Rd +++ b/man/derive_basetype_records.Rd @@ -101,8 +101,8 @@ count(bds_with_basetype, BASETYPE, name = "Number of Records") BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_param_extreme_record.Rd b/man/derive_param_extreme_record.Rd index f90a47fd27..d64cc94d98 100644 --- a/man/derive_param_extreme_record.Rd +++ b/man/derive_param_extreme_record.Rd @@ -148,8 +148,8 @@ derive_param_extreme_record( Other superseded: \code{\link{date_source}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dtm}()}, \code{\link{derive_var_extreme_dt}()}, +\code{\link{derive_var_extreme_dtm}()}, \code{\link{dthcaus_source}()}, \code{\link{get_summary_records}()} } diff --git a/man/derive_var_analysis_ratio.Rd b/man/derive_var_analysis_ratio.Rd index 9a9b2b7786..799d9a0ce2 100644 --- a/man/derive_var_analysis_ratio.Rd +++ b/man/derive_var_analysis_ratio.Rd @@ -71,8 +71,8 @@ data \%>\% BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_anrind.Rd b/man/derive_var_anrind.Rd index 1446f9db21..47e6ee54f7 100644 --- a/man/derive_var_anrind.Rd +++ b/man/derive_var_anrind.Rd @@ -79,8 +79,8 @@ vs \%>\% derive_var_anrind(use_a1hia1lo = FALSE) BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_base.Rd b/man/derive_var_base.Rd index 5d5a093c47..6f1eae00d9 100644 --- a/man/derive_var_base.Rd +++ b/man/derive_var_base.Rd @@ -97,8 +97,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, \code{\link{derive_var_pchg}()}, diff --git a/man/derive_var_chg.Rd b/man/derive_var_chg.Rd index 8a8df5a60b..440d374ac7 100644 --- a/man/derive_var_chg.Rd +++ b/man/derive_var_chg.Rd @@ -37,8 +37,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_ontrtfl}()}, \code{\link{derive_var_pchg}()}, diff --git a/man/derive_var_dthcaus.Rd b/man/derive_var_dthcaus.Rd index 5cf2117bd3..47aa93a425 100644 --- a/man/derive_var_dthcaus.Rd +++ b/man/derive_var_dthcaus.Rd @@ -150,8 +150,8 @@ derive_var_dthcaus( Other superseded: \code{\link{date_source}()}, \code{\link{derive_param_extreme_record}()}, -\code{\link{derive_var_extreme_dtm}()}, \code{\link{derive_var_extreme_dt}()}, +\code{\link{derive_var_extreme_dtm}()}, \code{\link{dthcaus_source}()}, \code{\link{get_summary_records}()} } diff --git a/man/derive_var_extreme_flag.Rd b/man/derive_var_extreme_flag.Rd index 08b2b19de5..7deac86681 100644 --- a/man/derive_var_extreme_flag.Rd +++ b/man/derive_var_extreme_flag.Rd @@ -270,8 +270,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_joined_exist_flag.Rd b/man/derive_var_joined_exist_flag.Rd index fd7f0c3e52..68afcaf1d4 100644 --- a/man/derive_var_joined_exist_flag.Rd +++ b/man/derive_var_joined_exist_flag.Rd @@ -493,8 +493,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_merged_ef_msrc.Rd b/man/derive_var_merged_ef_msrc.Rd index e80a4b046b..538921116d 100644 --- a/man/derive_var_merged_ef_msrc.Rd +++ b/man/derive_var_merged_ef_msrc.Rd @@ -196,8 +196,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_merged_exist_flag.Rd b/man/derive_var_merged_exist_flag.Rd index 3462ef8143..70a3071677 100644 --- a/man/derive_var_merged_exist_flag.Rd +++ b/man/derive_var_merged_exist_flag.Rd @@ -154,8 +154,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_merged_summary.Rd b/man/derive_var_merged_summary.Rd index 91d22b76e2..fd50515c21 100644 --- a/man/derive_var_merged_summary.Rd +++ b/man/derive_var_merged_summary.Rd @@ -187,8 +187,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_obs_number.Rd b/man/derive_var_obs_number.Rd index 91866338e7..b727cc7f7d 100644 --- a/man/derive_var_obs_number.Rd +++ b/man/derive_var_obs_number.Rd @@ -105,8 +105,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_ontrtfl.Rd b/man/derive_var_ontrtfl.Rd index 530c7c42a2..a2092e97e8 100644 --- a/man/derive_var_ontrtfl.Rd +++ b/man/derive_var_ontrtfl.Rd @@ -197,8 +197,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_pchg}()}, diff --git a/man/derive_var_pchg.Rd b/man/derive_var_pchg.Rd index 70b6749fcb..bb6880d031 100644 --- a/man/derive_var_pchg.Rd +++ b/man/derive_var_pchg.Rd @@ -41,8 +41,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_relative_flag.Rd b/man/derive_var_relative_flag.Rd index 4f31e91ffe..4fc22c0565 100644 --- a/man/derive_var_relative_flag.Rd +++ b/man/derive_var_relative_flag.Rd @@ -181,8 +181,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_obs_number}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_var_shift.Rd b/man/derive_var_shift.Rd index 3bdc2b5d07..0a2cea5336 100644 --- a/man/derive_var_shift.Rd +++ b/man/derive_var_shift.Rd @@ -84,8 +84,8 @@ BDS-Findings Functions that returns variable appended to dataset: \code{\link{derive_basetype_records}()}, \code{\link{derive_var_analysis_ratio}()}, \code{\link{derive_var_anrind}()}, -\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_atoxgr}()}, +\code{\link{derive_var_atoxgr_dir}()}, \code{\link{derive_var_base}()}, \code{\link{derive_var_chg}()}, \code{\link{derive_var_ontrtfl}()}, diff --git a/man/derive_var_trtdurd.Rd b/man/derive_var_trtdurd.Rd index d6de2f71e2..19be989dd5 100644 --- a/man/derive_var_trtdurd.Rd +++ b/man/derive_var_trtdurd.Rd @@ -56,10 +56,10 @@ derive_var_trtdurd(data) \code{\link[=derive_vars_duration]{derive_vars_duration()}} Date/Time Derivation Functions that returns variable appended to dataset: +\code{\link{derive_vars_dt}()}, +\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, -\code{\link{derive_vars_dtm}()}, -\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_computed.Rd b/man/derive_vars_computed.Rd index a87343bf6c..205f804d78 100644 --- a/man/derive_vars_computed.Rd +++ b/man/derive_vars_computed.Rd @@ -174,8 +174,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_obs_number}()}, \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_vars_dt.Rd b/man/derive_vars_dt.Rd index fdd728fa16..2536eb647a 100644 --- a/man/derive_vars_dt.Rd +++ b/man/derive_vars_dt.Rd @@ -235,9 +235,9 @@ derive_vars_dt( \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, +\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_dtm.Rd b/man/derive_vars_dtm.Rd index 954bef821f..702a408d1a 100644 --- a/man/derive_vars_dtm.Rd +++ b/man/derive_vars_dtm.Rd @@ -255,9 +255,9 @@ derive_vars_dtm( \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, +\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, -\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_dtm_to_dt.Rd b/man/derive_vars_dtm_to_dt.Rd index 55601eb360..c059bb62c6 100644 --- a/man/derive_vars_dtm_to_dt.Rd +++ b/man/derive_vars_dtm_to_dt.Rd @@ -47,9 +47,9 @@ adcm \%>\% \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dtm_to_tm}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dt}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dtm_to_tm}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_dtm_to_tm.Rd b/man/derive_vars_dtm_to_tm.Rd index a3b40c7c73..87642cf247 100644 --- a/man/derive_vars_dtm_to_tm.Rd +++ b/man/derive_vars_dtm_to_tm.Rd @@ -57,9 +57,9 @@ adcm \%>\% \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, -\code{\link{derive_vars_dtm_to_dt}()}, -\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dt}()}, +\code{\link{derive_vars_dtm}()}, +\code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_duration}()}, \code{\link{derive_vars_dy}()} } diff --git a/man/derive_vars_duration.Rd b/man/derive_vars_duration.Rd index d40c7edf18..bf9b324aba 100644 --- a/man/derive_vars_duration.Rd +++ b/man/derive_vars_duration.Rd @@ -234,10 +234,10 @@ derive_vars_duration( Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, +\code{\link{derive_vars_dt}()}, +\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, -\code{\link{derive_vars_dtm}()}, -\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_dy}()} } \concept{der_date_time} diff --git a/man/derive_vars_dy.Rd b/man/derive_vars_dy.Rd index 3591eca955..8a3f15964b 100644 --- a/man/derive_vars_dy.Rd +++ b/man/derive_vars_dy.Rd @@ -79,10 +79,10 @@ derive_vars_dy( \seealso{ Date/Time Derivation Functions that returns variable appended to dataset: \code{\link{derive_var_trtdurd}()}, +\code{\link{derive_vars_dt}()}, +\code{\link{derive_vars_dtm}()}, \code{\link{derive_vars_dtm_to_dt}()}, \code{\link{derive_vars_dtm_to_tm}()}, -\code{\link{derive_vars_dtm}()}, -\code{\link{derive_vars_dt}()}, \code{\link{derive_vars_duration}()} } \concept{der_date_time} diff --git a/man/derive_vars_joined.Rd b/man/derive_vars_joined.Rd index f2595212f0..2730270870 100644 --- a/man/derive_vars_joined.Rd +++ b/man/derive_vars_joined.Rd @@ -505,8 +505,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_obs_number}()}, \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, -\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()}, \code{\link{derive_vars_transposed}()} } \concept{der_gen} diff --git a/man/derive_vars_transposed.Rd b/man/derive_vars_transposed.Rd index 891b2e5043..eb058a5383 100644 --- a/man/derive_vars_transposed.Rd +++ b/man/derive_vars_transposed.Rd @@ -109,8 +109,8 @@ General Derivation Functions for all ADaMs that returns variable appended to dat \code{\link{derive_var_relative_flag}()}, \code{\link{derive_vars_computed}()}, \code{\link{derive_vars_joined}()}, -\code{\link{derive_vars_merged_lookup}()}, -\code{\link{derive_vars_merged}()} +\code{\link{derive_vars_merged}()}, +\code{\link{derive_vars_merged_lookup}()} } \concept{der_gen} \keyword{der_gen} diff --git a/man/dt_level.Rd b/man/dt_level.Rd index 920a162c8a..48631ac7ed 100644 --- a/man/dt_level.Rd +++ b/man/dt_level.Rd @@ -28,8 +28,8 @@ Utilities used for date imputation: \code{\link{get_imputation_target_date}()}, \code{\link{get_imputation_target_time}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dtm}()}, -\code{\link{restrict_imputed_dtc_dt}()} +\code{\link{restrict_imputed_dtc_dt}()}, +\code{\link{restrict_imputed_dtc_dtm}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/dthcaus_source.Rd b/man/dthcaus_source.Rd index 90c7c7cd98..968cf9c8f4 100644 --- a/man/dthcaus_source.Rd +++ b/man/dthcaus_source.Rd @@ -79,8 +79,8 @@ Other superseded: \code{\link{date_source}()}, \code{\link{derive_param_extreme_record}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dtm}()}, \code{\link{derive_var_extreme_dt}()}, +\code{\link{derive_var_extreme_dtm}()}, \code{\link{get_summary_records}()} } \concept{superseded} diff --git a/man/dtm_level.Rd b/man/dtm_level.Rd index 63ebf90389..b5fa5d88ea 100644 --- a/man/dtm_level.Rd +++ b/man/dtm_level.Rd @@ -29,8 +29,8 @@ Utilities used for date imputation: \code{\link{get_imputation_target_date}()}, \code{\link{get_imputation_target_time}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dtm}()}, -\code{\link{restrict_imputed_dtc_dt}()} +\code{\link{restrict_imputed_dtc_dt}()}, +\code{\link{restrict_imputed_dtc_dtm}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/event_joined.Rd b/man/event_joined.Rd index c14e7a3aa7..c01958b8fd 100644 --- a/man/event_joined.Rd +++ b/man/event_joined.Rd @@ -285,8 +285,8 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event_source}()}, \code{\link{event}()}, +\code{\link{event_source}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/event_source.Rd b/man/event_source.Rd index 75b3321c1d..03e7b4913c 100644 --- a/man/event_source.Rd +++ b/man/event_source.Rd @@ -56,8 +56,8 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, -\code{\link{event_joined}()}, \code{\link{event}()}, +\code{\link{event_joined}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, diff --git a/man/ex_single.Rd b/man/ex_single.Rd index 80d2891a21..5bdcb56823 100644 --- a/man/ex_single.Rd +++ b/man/ex_single.Rd @@ -21,8 +21,8 @@ Other datasets: \code{\link{admiral_adlb}}, \code{\link{admiral_adsl}}, \code{\link{example_qs}}, -\code{\link{queries_mh}}, -\code{\link{queries}} +\code{\link{queries}}, +\code{\link{queries_mh}} } \concept{datasets} \keyword{datasets} diff --git a/man/example_qs.Rd b/man/example_qs.Rd index 10902ebde4..54845ed6e0 100644 --- a/man/example_qs.Rd +++ b/man/example_qs.Rd @@ -23,8 +23,8 @@ Other datasets: \code{\link{admiral_adlb}}, \code{\link{admiral_adsl}}, \code{\link{ex_single}}, -\code{\link{queries_mh}}, -\code{\link{queries}} +\code{\link{queries}}, +\code{\link{queries_mh}} } \concept{datasets} \keyword{datasets} diff --git a/man/extract_duplicate_records.Rd b/man/extract_duplicate_records.Rd index 184fb76205..816990253c 100644 --- a/man/extract_duplicate_records.Rd +++ b/man/extract_duplicate_records.Rd @@ -34,7 +34,7 @@ extract_duplicate_records(adsl, exprs(USUBJID)) } \seealso{ Other internal: -\code{\link{admiral}}, +\code{\link{admiral-package}}, \code{\link{format.basket_select}()}, \code{\link{signal_duplicate_records}()} } diff --git a/man/flag_event.Rd b/man/flag_event.Rd index 4790cdd3e5..57709e58d5 100644 --- a/man/flag_event.Rd +++ b/man/flag_event.Rd @@ -39,9 +39,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{query}()}, \code{\link{records_source}()}, \code{\link{tte_source}()} diff --git a/man/format.basket_select.Rd b/man/format.basket_select.Rd index fa5da5dcc8..c31aafefa0 100644 --- a/man/format.basket_select.Rd +++ b/man/format.basket_select.Rd @@ -26,7 +26,7 @@ format(basket_select(id = 42, scope = "NARROW", type = "smq")) \code{\link[=basket_select]{basket_select()}} Other internal: -\code{\link{admiral}}, +\code{\link{admiral-package}}, \code{\link{extract_duplicate_records}()}, \code{\link{signal_duplicate_records}()} } diff --git a/man/get_imputation_target_date.Rd b/man/get_imputation_target_date.Rd index 2f8248eae0..9091fa2cb1 100644 --- a/man/get_imputation_target_date.Rd +++ b/man/get_imputation_target_date.Rd @@ -48,8 +48,8 @@ Utilities used for date imputation: \code{\link{dtm_level}()}, \code{\link{get_imputation_target_time}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dtm}()}, -\code{\link{restrict_imputed_dtc_dt}()} +\code{\link{restrict_imputed_dtc_dt}()}, +\code{\link{restrict_imputed_dtc_dtm}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/get_imputation_target_time.Rd b/man/get_imputation_target_time.Rd index c15c4d2c49..fcb7750936 100644 --- a/man/get_imputation_target_time.Rd +++ b/man/get_imputation_target_time.Rd @@ -39,8 +39,8 @@ Utilities used for date imputation: \code{\link{dtm_level}()}, \code{\link{get_imputation_target_date}()}, \code{\link{get_partialdatetime}()}, -\code{\link{restrict_imputed_dtc_dtm}()}, -\code{\link{restrict_imputed_dtc_dt}()} +\code{\link{restrict_imputed_dtc_dt}()}, +\code{\link{restrict_imputed_dtc_dtm}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/get_partialdatetime.Rd b/man/get_partialdatetime.Rd index 8b4917859c..1ac459df46 100644 --- a/man/get_partialdatetime.Rd +++ b/man/get_partialdatetime.Rd @@ -33,8 +33,8 @@ Utilities used for date imputation: \code{\link{dtm_level}()}, \code{\link{get_imputation_target_date}()}, \code{\link{get_imputation_target_time}()}, -\code{\link{restrict_imputed_dtc_dtm}()}, -\code{\link{restrict_imputed_dtc_dt}()} +\code{\link{restrict_imputed_dtc_dt}()}, +\code{\link{restrict_imputed_dtc_dtm}()} } \concept{utils_impute} \keyword{internal} diff --git a/man/get_summary_records.Rd b/man/get_summary_records.Rd index 883c94370d..70e547b534 100644 --- a/man/get_summary_records.Rd +++ b/man/get_summary_records.Rd @@ -176,8 +176,8 @@ Other superseded: \code{\link{date_source}()}, \code{\link{derive_param_extreme_record}()}, \code{\link{derive_var_dthcaus}()}, -\code{\link{derive_var_extreme_dtm}()}, \code{\link{derive_var_extreme_dt}()}, +\code{\link{derive_var_extreme_dtm}()}, \code{\link{dthcaus_source}()} } \concept{superseded} diff --git a/man/impute_dtc_dt.Rd b/man/impute_dtc_dt.Rd index 2b677165df..8cb3dc4f14 100644 --- a/man/impute_dtc_dt.Rd +++ b/man/impute_dtc_dt.Rd @@ -181,8 +181,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, +\code{\link{convert_dtc_to_dtm}()}, \code{\link{impute_dtc_dtm}()} } \concept{com_date_time} diff --git a/man/impute_dtc_dtm.Rd b/man/impute_dtc_dtm.Rd index 479c214f3c..ac97948e01 100644 --- a/man/impute_dtc_dtm.Rd +++ b/man/impute_dtc_dtm.Rd @@ -223,8 +223,8 @@ Date/Time Computation Functions that returns a vector: \code{\link{compute_duration}()}, \code{\link{compute_tmf}()}, \code{\link{convert_date_to_dtm}()}, -\code{\link{convert_dtc_to_dtm}()}, \code{\link{convert_dtc_to_dt}()}, +\code{\link{convert_dtc_to_dtm}()}, \code{\link{impute_dtc_dt}()} } \concept{com_date_time} diff --git a/man/query.Rd b/man/query.Rd index df454b1996..61d871ea6f 100644 --- a/man/query.Rd +++ b/man/query.Rd @@ -138,9 +138,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{records_source}()}, \code{\link{tte_source}()} diff --git a/man/records_source.Rd b/man/records_source.Rd index 2b47fab421..7f3121a3f6 100644 --- a/man/records_source.Rd +++ b/man/records_source.Rd @@ -44,9 +44,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{tte_source}()} diff --git a/man/signal_duplicate_records.Rd b/man/signal_duplicate_records.Rd index 3eb0fa14b0..076bc3cbaf 100644 --- a/man/signal_duplicate_records.Rd +++ b/man/signal_duplicate_records.Rd @@ -45,7 +45,7 @@ signal_duplicate_records(adsl, exprs(USUBJID), cnd_type = "message") } \seealso{ Other internal: -\code{\link{admiral}}, +\code{\link{admiral-package}}, \code{\link{extract_duplicate_records}()}, \code{\link{format.basket_select}()} } diff --git a/man/tte_source.Rd b/man/tte_source.Rd index 612ef672de..f63a36d51d 100644 --- a/man/tte_source.Rd +++ b/man/tte_source.Rd @@ -44,9 +44,9 @@ Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, \code{\link{death_event}}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()} diff --git a/man/tte_source_objects.Rd b/man/tte_source_objects.Rd index 2668d39355..565de0e340 100644 --- a/man/tte_source_objects.Rd +++ b/man/tte_source_objects.Rd @@ -63,9 +63,9 @@ for (obj in list_tte_source_objects()$object) { Source Objects: \code{\link{basket_select}()}, \code{\link{censor_source}()}, +\code{\link{event}()}, \code{\link{event_joined}()}, \code{\link{event_source}()}, -\code{\link{event}()}, \code{\link{flag_event}()}, \code{\link{query}()}, \code{\link{records_source}()}, From 0542e1f418b66b30e87ab72ca208e9284fff23ba Mon Sep 17 00:00:00 2001 From: Kangjie Zhang Date: Mon, 3 Jun 2024 17:02:59 -0700 Subject: [PATCH 17/19] #2302: update group_var/subject_key description, check, and example --- R/derive_var_trtemfl.R | 31 +++++++++++++++++++++---------- man/derive_var_trtemfl.Rd | 21 +++++++++++---------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 1f8e77bcc4..388215d6d7 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -77,18 +77,22 @@ #' If the argument is specified, it assumes that AEs are recorded as one episode #' of AE with multiple lines using a grouping variable. #' -#' If the argument is specified, events which started during the treatment period -#' irrespective of worsening condition or events which start before treatment start -#' and end after treatment start (or are ongoing) and worsened during treatment -#' (i.e., the intensity is greater than the previous intensity), are flagged. -#' -#' Once an AE record within a grouped AE is flagged, then any subsequent record -#' is also flagged regardless of the severity and within the treatment window. +#' Events starting during treatment or before treatment and worsening afterward +#' are flagged. Once an AE record in a group is flagged, all subsequent records +#' in the treatment window are flagged regardless of severity. #' #' *Permitted Values:* A symbol referring to a variable of the input dataset #' or `NULL` #' -#' @inheritParams derive_param_tte +#' @param subject_keys Variables to uniquely identify a subject. +#' +#' A list of symbols created using `exprs()` is expected. This argument is only +#' used when `group_var` is specified. +#' +#' Default: `get_admiral_option("subject_keys")[2]` +#' +#' For admiral options, see [`get_admiral_option`](../reference/get_admiral_option.html) +#' and [`set_admiral_options`](../reference/set_admiral_options.html) #' #' @details For the derivation of the new variable the following cases are #' considered in this order. The first case which applies, defines the value @@ -218,7 +222,6 @@ #' new_var = TRTEMFL, #' trt_end_date = TRTEDTM, #' end_window = 10, -#' initial_intensity = AEITOXGR, #' intensity = AETOXGR, #' group_var = AEGRPID #' ) %>% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, AEGRPID, TRTEMFL) @@ -268,9 +271,17 @@ derive_var_trtemfl <- function(dataset, } else { if (!is.null(initial_intensity)) { cli_warn(c( - "{.arg initial_intensity} argument is ignored when {.arg group_var} is specified" + "{.arg initial_intensity} argument is ignored when {.arg group_var} is specified", + "Please only specify one of them." + )) + } + if (is.null(subject_keys)) { + cli_abort(c( + "{.arg group_var} argument was specified but not {.arg subject_keys}", + "{.arg subject_keys} argument must be provided when {.arg group_var} is specified." )) } + assert_vars(subject_keys) } # Assert required variables diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index 8e238a4a71..6d8d2002bd 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -91,20 +91,22 @@ or \code{NULL}} If the argument is specified, it assumes that AEs are recorded as one episode of AE with multiple lines using a grouping variable. -If the argument is specified, events which started during the treatment period -irrespective of worsening condition or events which start before treatment start -and end after treatment start (or are ongoing) and worsened during treatment -(i.e., the intensity is greater than the previous intensity), are flagged. - -Once an AE record within a grouped AE is flagged, then any subsequent record -is also flagged regardless of the severity and within the treatment window. +Events starting during treatment or before treatment and worsening afterward +are flagged. Once an AE record in a group is flagged, all subsequent records +in the treatment window are flagged regardless of severity. \emph{Permitted Values:} A symbol referring to a variable of the input dataset or \code{NULL}} -\item{subject_keys}{Variables to uniquely identify a subject +\item{subject_keys}{Variables to uniquely identify a subject. + +A list of symbols created using \code{exprs()} is expected. This argument is only +used when \code{group_var} is specified. -A list of symbols created using \code{exprs()} is expected.} +Default: \code{get_admiral_option("subject_keys")[2]} + +For admiral options, see \href{../reference/get_admiral_option.html}{\code{get_admiral_option}} +and \href{../reference/set_admiral_options.html}{\code{set_admiral_options}}} } \value{ The input dataset with the variable specified by \code{new_var} added @@ -237,7 +239,6 @@ derive_var_trtemfl( new_var = TRTEMFL, trt_end_date = TRTEDTM, end_window = 10, - initial_intensity = AEITOXGR, intensity = AETOXGR, group_var = AEGRPID ) \%>\% select(ASTDTM, AENDTM, AEITOXGR, AETOXGR, AEGRPID, TRTEMFL) From 70fdf3a094cd69120a0587d26be5cbb1f7a34db6 Mon Sep 17 00:00:00 2001 From: Stefan Bundfuss Date: Tue, 4 Jun 2024 12:48:43 +0000 Subject: [PATCH 18/19] #2302 enhance_derive_var_trtemfl: update subject_keys argument --- R/derive_var_trtemfl.R | 7 +------ man/derive_var_trtemfl.Rd | 9 ++------- tests/testthat/test-derive_var_trtemfl.R | 1 + 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index 388215d6d7..fe47e79232 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -89,11 +89,6 @@ #' A list of symbols created using `exprs()` is expected. This argument is only #' used when `group_var` is specified. #' -#' Default: `get_admiral_option("subject_keys")[2]` -#' -#' For admiral options, see [`get_admiral_option`](../reference/get_admiral_option.html) -#' and [`set_admiral_options`](../reference/set_admiral_options.html) -#' #' @details For the derivation of the new variable the following cases are #' considered in this order. The first case which applies, defines the value #' of the variable. @@ -237,7 +232,7 @@ derive_var_trtemfl <- function(dataset, initial_intensity = NULL, intensity = NULL, group_var = NULL, - subject_keys = get_admiral_option("subject_keys")[2]) { + subject_keys = get_admiral_option("subject_keys")) { # Convert inputs to symbols new_var <- assert_symbol(enexpr(new_var)) start_date <- assert_symbol(enexpr(start_date)) diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index 6d8d2002bd..2b6f65286f 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -16,7 +16,7 @@ derive_var_trtemfl( initial_intensity = NULL, intensity = NULL, group_var = NULL, - subject_keys = get_admiral_option("subject_keys")[2] + subject_keys = get_admiral_option("subject_keys") ) } \arguments{ @@ -101,12 +101,7 @@ or \code{NULL}} \item{subject_keys}{Variables to uniquely identify a subject. A list of symbols created using \code{exprs()} is expected. This argument is only -used when \code{group_var} is specified. - -Default: \code{get_admiral_option("subject_keys")[2]} - -For admiral options, see \href{../reference/get_admiral_option.html}{\code{get_admiral_option}} -and \href{../reference/set_admiral_options.html}{\code{set_admiral_options}}} +used when \code{group_var} is specified.} } \value{ The input dataset with the variable specified by \code{new_var} added diff --git a/tests/testthat/test-derive_var_trtemfl.R b/tests/testthat/test-derive_var_trtemfl.R index c6317e52f9..c110da5730 100644 --- a/tests/testthat/test-derive_var_trtemfl.R +++ b/tests/testthat/test-derive_var_trtemfl.R @@ -64,6 +64,7 @@ expected2 <- tribble( "2", "2021-12-06T18:00", "", "1", "2", "3", NA, NA ) %>% mutate( + STUDYID = "ABC12345", ASTDTM = lubridate::ymd_hm(ASTDTM), AENDTM = lubridate::ymd_hm(AENDTM), TRTSDTM = if_else(USUBJID != "2", lubridate::ymd_hm("2022-01-01T01:01"), ymd_hms("")), From 4e9de5eaaa6015c076393d7058e10313396c9780 Mon Sep 17 00:00:00 2001 From: Stefan Bundfuss Date: Tue, 4 Jun 2024 13:02:35 +0000 Subject: [PATCH 19/19] #2302 enhance_derive_var_trtemfl: fix example --- R/derive_var_trtemfl.R | 1 + man/derive_var_trtemfl.Rd | 1 + 2 files changed, 2 insertions(+) diff --git a/R/derive_var_trtemfl.R b/R/derive_var_trtemfl.R index fe47e79232..c12435bf44 100644 --- a/R/derive_var_trtemfl.R +++ b/R/derive_var_trtemfl.R @@ -205,6 +205,7 @@ #' "2", "2021-12-06T18:00", "", "1", "2", "3" #' ) %>% #' mutate( +#' STUDYID = "ABC12345", #' ASTDTM = ymd_hm(ASTDTM), #' AENDTM = ymd_hm(AENDTM), #' TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")), diff --git a/man/derive_var_trtemfl.Rd b/man/derive_var_trtemfl.Rd index 2b6f65286f..319a6006a4 100644 --- a/man/derive_var_trtemfl.Rd +++ b/man/derive_var_trtemfl.Rd @@ -223,6 +223,7 @@ adae2 <- tribble( "2", "2021-12-06T18:00", "", "1", "2", "3" ) \%>\% mutate( + STUDYID = "ABC12345", ASTDTM = ymd_hm(ASTDTM), AENDTM = ymd_hm(AENDTM), TRTSDTM = if_else(USUBJID == "1", ymd_hm("2022-01-01T01:01"), ymd_hms("")),