| Type: | Package | 
| Title: | Oncology Extension Package for ADaM in 'R' Asset Library | 
| Version: | 1.3.0 | 
| Description: | Programming oncology specific Clinical Data Interchange Standards Consortium (CDISC) compliant Analysis Data Model (ADaM) datasets in 'R'. ADaM datasets are a mandatory part of any New Drug or Biologics License Application submitted to the United States Food and Drug Administration (FDA). Analysis derivations are implemented in accordance with the "Analysis Data Model Implementation Guide" (CDISC Analysis Data Model Team (2021), https://www.cdisc.org/standards/foundational/adam). The package is an extension package of the 'admiral' package. | 
| Language: | en-US | 
| License: | Apache License (≥ 2) | 
| BugReports: | https://github.com/pharmaverse/admiralonco/issues | 
| URL: | https://pharmaverse.github.io/admiralonco/, https://github.com/pharmaverse/admiralonco | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| RoxygenNote: | 7.3.2 | 
| Depends: | R (≥ 3.5) | 
| Imports: | admiral (≥ 1.0.0), admiraldev (≥ 1.0.0), dplyr (≥ 0.8.4), lifecycle (≥ 0.1.0), lubridate (≥ 1.7.4), magrittr (≥ 1.5), rlang (≥ 0.4.4), tidyselect (≥ 1.0.0) | 
| Suggests: | pharmaversesdtm, pharmaverseadam, devtools, diffdf, lintr, pkgdown, testthat (≥ 3.0.0), knitr, methods, miniUI, rmarkdown, roxygen2, spelling, stringr, tibble, usethis, covr, DT, metatools, cli, gt | 
| VignetteBuilder: | knitr | 
| Config/testthat/edition: | 3 | 
| NeedsCompilation: | no | 
| Packaged: | 2025-09-01 09:42:36 UTC; bundfuss | 
| Author: | Stefan Bundfuss [aut, cre], Amit Jain [aut], Vinh Nguyen [aut], Olga Starostecka [aut], Kiran Peddamudium [aut], Tomoyuki Namai [aut], Ross Farrugia [aut], Yirong Cao [ctb], Ashwini Weber [ctb], F. Hoffmann-La Roche AG [cph, fnd], GlaxoSmithKline LLC [cph, fnd], Amgen Inc. [cph, fnd], Bristol Myers Squibb [cph, fnd] | 
| Maintainer: | Stefan Bundfuss <stefan.bundfuss@roche.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-09-01 10:20:12 UTC | 
admiralonco: Oncology Extension Package for ADaM in 'R' Asset Library
Description
 
Programming oncology specific Clinical Data Interchange Standards Consortium (CDISC) compliant Analysis Data Model (ADaM) datasets in 'R'. ADaM datasets are a mandatory part of any New Drug or Biologics License Application submitted to the United States Food and Drug Administration (FDA). Analysis derivations are implemented in accordance with the "Analysis Data Model Implementation Guide" (CDISC Analysis Data Model Team (2021), https://www.cdisc.org/standards/foundational/adam). The package is an extension package of the 'admiral' package.
Author(s)
Maintainer: Stefan Bundfuss stefan.bundfuss@roche.com
Authors:
- Amit Jain 
- Vinh Nguyen 
- Olga Starostecka 
- Kiran Peddamudium 
- Tomoyuki Namai 
- Ross Farrugia 
Other contributors:
- Yirong Cao [contributor] 
- Ashwini Weber [contributor] 
- F. Hoffmann-La Roche AG [copyright holder, funder] 
- GlaxoSmithKline LLC [copyright holder, funder] 
- Amgen Inc. [copyright holder, funder] 
- Bristol Myers Squibb [copyright holder, funder] 
See Also
Useful links:
- Report bugs at https://github.com/pharmaverse/admiralonco/issues 
Response Analysis Dataset
Description
An example response analysis dataset
Usage
admiral_adrs
Format
An object of class tbl_df (inherits from tbl, data.frame) with 3694 rows and 75 columns.
Source
Derived from the adsl, rs and tu datasets using {admiralonco}
(https://github.com/pharmaverse/admiralonco/blob/main/inst/templates/ad_adrs.R)
Map Character Response Values to Numeric Values
Description
Map character response values like "PR" or "SD" to numeric values.
Usage
aval_resp(arg)
Arguments
| arg | Character vector | 
Value
-  1ifargequals"CR",
-  2ifargequals"PR",
-  3ifargequals"SD",
-  4ifargequals"NON-CR/NON-PD",
-  5ifargequals"PD",
-  6ifargequals"NE",
-  7ifargequals"MISSING",
-  NA_real_otherwise
Author(s)
Stefan Bundfuss
Examples
aval_resp(c("CR", "PR", "SD", "NON-CR/NON-PD", "PD", "NE", "MISSING", "ND", NA_character_))
Pre-Defined Time-to-Event Source Objects
Description
These pre-defined tte_source objects can be used as input to admiral::derive_param_tte().
Usage
death_event
lastalive_censor
pd_event
lasta_censor
rand_censor
trts_censor
Details
To see the definition of the various objects simply print the object in the
R console, e.g. print(death_event). For details of how to use these objects
please refer to admiral::derive_param_tte().
Printing an object will display input dataset_name, filter (if applicable), date variable,
and appropriate values for EVNTDESC, CNSDTDSC, SRCDOM, SRCVAR, and SRCSEQ.
See Also
admiral::derive_param_tte(), admiral::tte_source(), admiral::event_source(),
admiral::censor_source()
Examples
# This shows the definition of all pre-defined `tte_source` objects that ship
# with {admiralonco}
for (obj in admiral::list_tte_source_objects(package = "admiralonco")$object) {
  cat(obj, "\n")
  print(get(obj, envir = getNamespace("admiralonco")))
  cat("\n")
}
Adds a Parameter for Best Overall Response (without confirmation)
Description
 The 
derive_param_bor() function has been
superseded in favor of derive_extreme_event().
Adds a parameter for best overall response, without confirmation, optionally up to first progressive disease
Usage
derive_param_bor(
  dataset,
  dataset_adsl,
  filter_source,
  source_pd = NULL,
  source_datasets = NULL,
  reference_date,
  ref_start_window,
  missing_as_ne = FALSE,
  aval_fun,
  set_values_to,
  subject_keys = get_admiral_option("subject_keys")
)
Arguments
| dataset | The input dataframe from which the Best Overall Response will be derived from and added to. The columns  After applying  Permitted Values: a  | 
| dataset_adsl | ADSL input dataset. The columns specified in the subject_keys argument are expected. For each subject in
the passed  Permitted Values: a  | 
| filter_source | Filter to be applied to  | 
| source_pd | Date of first progressive disease (PD) If the parameter is specified, the observations of the input  Permitted Values: a  | 
| source_datasets | Source dataframe to be used to calculate the first PD date A named list of dataframes is expected (although for BOR) only one dataframe is
needed. It links the  For example if  pd_date <- date_source( dataset_name = "adrs", date = ADT, filter = PARAMCD == PD ) and the actual response dataframe in the script is  | 
| reference_date | Reference date The reference date is used along with  Permitted Values: a numeric date column | 
| ref_start_window | Stable disease time window The ref_start_window is used along with  Permitted Values: a non-negative numeric scalar | 
| missing_as_ne | Consider no assessments as  If the argument is set to  Permitted Values: a logical scalar | 
| aval_fun | Deprecated, please use  Function to map character analysis value ( The (first) argument of the function must expect a character vector and the function must return a numeric vector. | 
| set_values_to | New columns to set A named list returned by  | 
| subject_keys | Columns to uniquely identify a subject Permitted Values: A list of symbols created using  | 
Details
Calculates the best overall response (BOR) parameter, as detailed below.
Records after PD can be removed using the source_pd and source_datasets arguments.
Note:
- All - CR,- PRand- PDresponse records are considered for Best Overall Response.
- All - SDor- NON-CR/NON-PDrecords where- ADT>=- reference_date+- ref_start_windoware also considered for Best Overall Response.
- Subjects with ONLY an - SDor- NON-CR/NON-PDrecords where- ADT<- reference_date+- ref_start_windoware assigned a Best Overall Response of- NE.
- The Best Response, from the records in steps 1 to 3, is then selected in the following order of preference: CR, PR, SD, NON-CR/NON-PD, PD, NE, MISSING 
- The - AVALcolumn is added and set using the- aval_fun(AVALC)function
- The columns specified by the - set_values_toparameter and records are added to the dataframe passed into the- datasetargument
Note: Any responses of SD or NON-CR/NON-PD that occur before reference_date +
ref_start_window are ignored in the calculation of BOR. All other responses are included
in the calculation of BOR, irrespective of the number of days from the reference date.
Also Note: All columns from the input dataset are kept. For subjects with no records in
the input dataset (after the filter is applied) all columns are kept from ADSL which are
also in the input dataset.  Columns which are not to be populated for the new parameter
or populated differently (e.g. RSSTRESC, VISIT, PARCATy, ANLzzFL, ...) should be
overwritten using the set_values_to parameter.
Value
The dataframe passed in the dataset argument with additional columns and/or
rows as set in the set_values_to argument.
Author(s)
Stephen Gormley
See Also
Other superseded: 
derive_param_clinbenefit(),
derive_param_confirmed_bor(),
derive_param_confirmed_resp(),
derive_param_response(),
filter_pd()
Examples
library(magrittr)
library(dplyr)
library(tibble)
library(lubridate)
library(admiral)
# Create ADSL dataset
adsl <- tribble(
  ~USUBJID, ~TRTSDTC,
  "1",      "2020-01-01",
  "2",      "2019-12-12",
  "3",      "2019-11-11",
  "4",      "2019-12-30",
  "5",      "2020-01-01",
  "6",      "2020-02-02",
  "7",      "2020-02-02",
  "8",      "2020-04-01"
) %>%
  mutate(
    TRTSDT = ymd(TRTSDTC),
    STUDYID = "XX1234"
  )
# Create ADRS dataset
ovr_obs <- tribble(
  ~USUBJID, ~ADTC, ~AVALC, ~ANL01FL,
  "1", "2020-01-01", "PR", "Y",
  "1", "2020-02-01", "CR", "Y",
  "1", "2020-02-16", "NE", "Y",
  "1", "2020-03-01", "CR", "Y",
  "1", "2020-04-01", "SD", "Y",
  "2", "2020-01-01", "SD", "Y",
  "2", "2020-02-01", "PR", "Y",
  "2", "2020-03-01", "SD", "Y",
  "2", "2020-03-13", "CR", "Y",
  "3", "2019-11-12", "CR", "Y",
  "3", "2019-12-02", "CR", "Y",
  "3", "2020-01-01", "SD", "Y",
  "4", "2020-01-01", "PR", "Y",
  "4", "2020-03-01", "SD", "N",
  "4", "2020-04-01", "SD", "Y",
  "4", "2020-05-01", "PR", "Y",
  "4", "2020-05-15", "NON-CR/NON-PD", "Y",
  "5", "2020-01-01", "PR", "Y",
  "5", "2020-01-10", "SD", "Y",
  "5", "2020-01-20", "PR", "Y",
  "5", "2020-05-15", "NON-CR/NON-PD", "Y",
  "6", "2020-02-06", "PR", "Y",
  "6", "2020-02-16", "CR", "Y",
  "6", "2020-03-30", "PR", "Y",
  "6", "2020-04-12", "PD", "Y",
  "6", "2020-05-01", "CR", "Y",
  "6", "2020-06-01", "CR", "Y",
  "7", "2020-02-06", "PR", "Y",
  "7", "2020-02-16", "CR", "Y",
  "7", "2020-04-01", "NE", "N"
) %>%
  mutate(PARAMCD = "OVR")
pd_obs <-
  bind_rows(tribble(
    ~USUBJID, ~ADTC,        ~AVALC,
    "2",      "2020-03-01", "Y",
    "4",      "2020-02-01", "Y"
  ) %>%
    mutate(PARAMCD = "PD"))
adrs <- bind_rows(ovr_obs, pd_obs) %>%
  mutate(
    ADT = ymd(ADTC),
    STUDYID = "XX1234"
  ) %>%
  select(-ADTC) %>%
  derive_vars_merged(
    dataset_add = adsl,
    by_vars     = exprs(STUDYID, USUBJID),
    new_vars    = exprs(TRTSDT)
  )
pd_date <- date_source(
  dataset_name = "adrs",
  date         = ADT,
  filter       = PARAMCD == "PD"
)
aval_fun_pass <- function(arg) {
  case_when(
    arg == "CR" ~ 11,
    arg == "PR" ~ 22,
    arg == "SD" ~ 33,
    arg == "NON-CR/NON-PD" ~ 44,
    arg == "PD" ~ 55,
    arg == "NE" ~ 66,
    arg == "MISSING" ~ 77,
    TRUE ~ NA_real_
  )
}
# Derive best overall response parameter
derive_param_bor(
  adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd_date,
  source_datasets = list(adrs = adrs),
  aval_fun = aval_fun_pass,
  reference_date = TRTSDT,
  ref_start_window = 28,
  set_values_to = exprs(
    PARAMCD = "BOR",
    PARAM = "Best Overall Response"
  )
) %>%
  filter(PARAMCD == "BOR")
Adds a Parameter for Clinical Benefit
Description
 The 
derive_param_clinbenefit() function
has been superseded in favor of derive_extreme_event().
Adds a parameter for clinical benefit/disease control
Usage
derive_param_clinbenefit(
  dataset,
  dataset_adsl,
  filter_source,
  source_resp,
  source_pd = NULL,
  source_datasets,
  reference_date,
  ref_start_window,
  aval_fun,
  clinben_vals = c("CR", "PR", "SD", "NON-CR/NON-PD"),
  set_values_to,
  subject_keys = get_admiral_option("subject_keys")
)
Arguments
| dataset | Input dataset. This is the dataset to which the clinical benefit rate parameter will be added. The variables  After applying  | 
| dataset_adsl | ADSL input dataset. The variables specified for  | 
| filter_source | Filter condition in  | 
| source_resp | A  | 
| source_pd | A  | 
| source_datasets | A named list of data sets is expected. The list must contain the names provided by the  | 
| reference_date | Name of variable representing the index date for
 | 
| ref_start_window | Integer representing number of days from  | 
| aval_fun | Deprecated, please use  Function to map character analysis value ( The (first) argument of the function must expect a character vector and the function must return a numeric vector. | 
| clinben_vals | A vector of response values to be considered when determining clinical benefit. | 
| set_values_to | A named list returned by  | 
| subject_keys | A named list returned by  | 
Details
Clinical benefit/disease control is first identified by looking for subjects
having response status, and then derived for subjects that have at least one
evaluable non-PD response assessment prior to first PD (Progressive Disease)
(i.e., responses inclusive of CR, PR, SD, and NON-CR/NON-PD) and after a specified
amount of time from a reference date (ref_start_window).
Note: The user input values they wish to include when determining
clinical benefit using the argument clinben_vals. The default values for this are
CR, PR, SD, and NON-CR/NON-PD, as listed above. In the below example,
eligible values be limited to CR and PR.
Example: clinben_vals <- c("CR", "PR")
- The input dataset ( - dataset) is restricted to the observations matching- filter_sourceand to observations before or at the date specified by- source_pd.
- This dataset is further restricted to include user-generated response assessments from - clinben_valsor include response assessments of- CR,- PR,- SD, and- NON-CR/NON-PD, exclude missing response assessments, and exclude those less than- ref_start_windowafter- reference_date. The earliest assessment by- ADTis then selected.
- The dataset identified by - datasetin- source_respis restricted according to its- filterargument. The variable corresponding to the- dateparameter of- source_respis considered together with- ADTfrom the previous step.
- For the observations being added to - dataset,- ADTis set to the earlier of the first assessment date representing an evaluable non-PD assessment prior to first PD, or the date representing the start of response.
- For the observations being added to - dataset,- AVALCis set to-  Yfor those subjects in thedatasetmeeting the criteria for clinical benefit above
-  Nfor subjects not meeting the clinical benefit criteria indatasetor the dataset identified insource_resp
-  Nfor subjects present indataset_adslbut not present indatasetor the dataset identified insource_resp.
 
-  
-  AVALis derived usingAVALCas input to the function specified inaval_fun.
- The variables specified by - set_values_toare added to the new observations with values equal to the values specified in the same.
- The new observations are added to - dataset. Variables held in common between- datasetand- dataset_adslare kept for the new observations, and are populated with their values from- dataset_adsl.
Value
The input dataset with a new parameter for clinical benefit
Author(s)
Andrew Smith
See Also
Other superseded: 
derive_param_bor(),
derive_param_confirmed_bor(),
derive_param_confirmed_resp(),
derive_param_response(),
filter_pd()
Examples
library(lubridate)
library(dplyr)
library(admiral)
adsl <- tibble::tribble(
  ~USUBJID, ~TRTSDT,
  "01",     ymd("2020-01-14"),
  "02",     ymd("2021-02-16"),
  "03",     ymd("2021-03-09"),
  "04",     ymd("2021-04-21")
) %>%
  mutate(STUDYID = "AB42")
adrs <- tibble::tribble(
  ~USUBJID, ~PARAMCD, ~AVALC, ~ADT,
  "01",     "RSP",    "Y",    ymd("2021-03-14"),
  "02",     "RSP",    "N",    ymd("2021-05-07"),
  "03",     "RSP",    "N",    NA,
  "04",     "RSP",    "N",    NA,
  "01",     "PD",     "N",    NA,
  "02",     "PD",     "Y",    ymd("2021-05-07"),
  "03",     "PD",     "N",    NA,
  "04",     "PD",     "N",    NA,
  "01",     "OVR",    "SD",   ymd("2020-03-14"),
  "01",     "OVR",    "PR",   ymd("2021-04-13"),
  "02",     "OVR",    "PR",   ymd("2021-04-08"),
  "02",     "OVR",    "PD",   ymd("2021-05-07"),
  "02",     "OVR",    "CR",   ymd("2021-06-20"),
  "03",     "OVR",    "SD",   ymd("2021-03-30"),
  "04",     "OVR",    "NE",   ymd("2021-05-21"),
  "04",     "OVR",    "NA",   ymd("2021-06-30"),
  "04",     "OVR",    "NE",   ymd("2021-07-24"),
  "04",     "OVR",    "ND",   ymd("2021-09-04"),
) %>%
  mutate(STUDYID = "AB42", ANL01FL = "Y") %>%
  derive_vars_merged(
    dataset_add = adsl,
    by_vars = exprs(STUDYID, USUBJID),
    new_vars = exprs(TRTSDT)
  )
pd <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "PD" & AVALC == "Y" & ANL01FL == "Y"
)
resp <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "RSP" & AVALC == "Y" & ANL01FL == "Y"
)
derive_param_clinbenefit(
  dataset = adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
  source_resp = resp,
  source_pd = pd,
  source_datasets = list(adrs = adrs),
  reference_date = TRTSDT,
  ref_start_window = 28,
  set_values_to = exprs(
    PARAMCD = "CBR"
  )
) %>%
  filter(PARAMCD == "CBR")
Adds a Parameter for Confirmed Best Overall Response
Description
 The 
derive_param_confirmed_bor()
function has been superseded in favor of derive_extreme_event().
Adds a parameter for confirmed best overall response (BOR)
Usage
derive_param_confirmed_bor(
  dataset,
  dataset_adsl,
  filter_source,
  source_pd = NULL,
  source_datasets = NULL,
  reference_date,
  ref_start_window,
  ref_confirm,
  max_nr_ne = 1,
  accept_sd = FALSE,
  missing_as_ne = FALSE,
  aval_fun,
  set_values_to,
  subject_keys = get_admiral_option("subject_keys")
)
Arguments
| dataset | Input dataset The  After applying  | 
| dataset_adsl | ADSL input dataset The variables specified for  | 
| filter_source | Source filter All observations in  | 
| source_pd | Date of first progressive disease (PD) If the parameter is specified, the observations of the input dataset for deriving the new parameter are restricted to observations up to the specified date. Observations at the specified date are included. For subjects without first PD date all observations are take into account. Permitted Values: a  | 
| source_datasets | Source dataset for the first PD date A named list of datasets is expected. It links the  For example if  pd_date <- date_source( dataset_name = "adrs", date = ADT, filter = PARAMCD == PD ) and the actual response dataset in the script is  | 
| reference_date | Reference date The reference date is used for the derivation of  Permitted Values: a numeric date variable | 
| ref_start_window | Stable disease time window Assessments at least the specified number of days after the reference date
(i.e. where  Permitted Values: a non-negative numeric scalar | 
| ref_confirm | Minimum time period for confirmation The assessment and the confirmatory assessment for  | 
| max_nr_ne | The specified number of  Permitted Values: a non-negative numeric scalar | 
| accept_sd | Accept  If the argument is set to  Permitted Values: a logical scalar | 
| missing_as_ne | Consider no assessments as  If the argument is set to  Permitted Values: a logical scalar | 
| aval_fun | Deprecated, please use  Function to map character analysis value ( The (first) argument of the function must expect a character vector and the function must return a numeric vector. | 
| set_values_to | Variables to set A named list returned by  | 
| subject_keys | Variables to uniquely identify a subject A list of symbols created using  | 
Details
- The input dataset ( - dataset) is restricted to the observations matching- filter_sourceand to observations before or at the date specified by- source_pd.
- The following potential confirmed responses are selected from the restricted input dataset: -  "CR": An assessment is considered as complete response (CR) if-  AVALC == "CR",
- there is a confirmatory assessment with - AVALC == "CR"at least- ref_confirmdays after the assessment,
- all assessments between the assessment and the confirmatory assessment are - "CR"or- "NE", and
- there are at most - max_nr_ne- "NE"assessments between the assessment and the confirmatory assessment.
 
-  
-  "PR": An assessment is considered as partial response (PR) if-  AVALC == "PR",
- there is a confirmatory assessment with - AVALC %in% c("CR", "PR")at least- ref_confirmdays after the assessment,
- all assessments between the assessment and the confirmatory assessment are - "CR",- "PR",- "SD", or- "NE",
- there is no - "PR"assessment after a- "CR"assessment in the confirmation period,
- there are at most - max_nr_ne- "NE"assessments between the assessment and the confirmatory assessment, and
- if the - accept_sdargument is set to- TRUE, one- "SD"assessment in the confirmation period is accepted. Otherwise, no- "SD"assessment must occur within the confirmation period.
 
-  
-  "SD": An assessment is considered as stable disease (SD) if-  AVALC %in% c("CR", "PR", "SD")and
- the assessment is at least - ref_start_windowdays after- reference_date.
 
-  
-  "NON-CR/NON-PD": An assessment is considered as NON-CR/NON-PD if-  AVALC = "NON-CR/NON-PD"and
- the assessment is at least - ref_start_windowdays after- reference_date.
 
-  
-  "PD": An assessment is considered as progressive disease (PD) ifAVALC == "PD".
-  "NE": An assessment is considered as not estimable (NE) if-  AVALC == "NE"or
-  AVALC %in% c("CR", "PR", "SD", "NON-CR/NON-PD")and the assessment is less thanref_start_windowdays afterreference_date.
 
-  
-  "ND": An assessment is considered as not done (ND) ifAVALC == "ND".
-  "MISSING": An assessment is considered as missing (MISSING) if a subject has no observation in the input dataset.If the missing_as_neargument is set toTRUE,AVALCis set to"NE"for these subjects.
 
-  
- For each subject the best response as derived in the previous step is selected, where - "CR"is best and- "MISSING"is worst in the order above. If the best response is not unique, the first one (with respect to- ADT) is selected. If the selected record is from the input dataset, all variables are kept. If the selected record is from- dataset_adsl, all variables which are in both- datasetand- dataset_adslare kept.
- The - AVALvariable is added and set to- aval_fun(AVALC).
- The variables specified by the - set_values_toparameter are added to the new observations.
- The new observations are added to input dataset. 
Value
The input dataset with a new parameter for confirmed best overall response
Author(s)
Stefan Bundfuss
See Also
Other superseded: 
derive_param_bor(),
derive_param_clinbenefit(),
derive_param_confirmed_resp(),
derive_param_response(),
filter_pd()
Examples
library(dplyr)
library(lubridate)
library(admiral)
# Create ADSL dataset
adsl <- tibble::tribble(
  ~USUBJID, ~TRTSDTC,
  "1",      "2020-01-01",
  "2",      "2019-12-12",
  "3",      "2019-11-11",
  "4",      "2019-12-30",
  "5",      "2020-01-01",
  "6",      "2020-02-02",
  "7",      "2020-02-02",
  "8",      "2020-04-01",
  "9",      "2020-03-01"
) %>%
  mutate(
    TRTSDT = ymd(TRTSDTC),
    STUDYID = "XX1234"
  )
# Create ADRS dataset
ovr_obs <- tibble::tribble(
  ~USUBJID, ~ADTC,        ~AVALC,
  "1",      "2020-01-01", "PR",
  "1",      "2020-02-01", "CR",
  "1",      "2020-02-16", "NE",
  "1",      "2020-03-01", "CR",
  "1",      "2020-04-01", "SD",
  "2",      "2020-01-01", "SD",
  "2",      "2020-02-01", "PR",
  "2",      "2020-03-01", "SD",
  "2",      "2020-03-13", "CR",
  "3",      "2019-11-12", "CR",
  "3",      "2019-12-02", "CR",
  "3",      "2020-01-01", "SD",
  "4",      "2020-01-01", "PR",
  "4",      "2020-03-01", "SD",
  "4",      "2020-04-01", "SD",
  "4",      "2020-05-01", "PR",
  "4",      "2020-05-15", "NON-CR/NON-PD",
  "5",      "2020-01-01", "PR",
  "5",      "2020-01-10", "SD",
  "5",      "2020-01-20", "PR",
  "5",      "2020-05-15", "NON-CR/NON-PD",
  "6",      "2020-02-06", "PR",
  "6",      "2020-02-16", "CR",
  "6",      "2020-03-30", "PR",
  "6",      "2020-04-12", "PD",
  "6",      "2020-05-01", "CR",
  "6",      "2020-06-01", "CR",
  "7",      "2020-02-06", "PR",
  "7",      "2020-02-16", "CR",
  "7",      "2020-04-01", "NE",
  "9",      "2020-03-16", "CR",
  "9",      "2020-04-01", "NE",
  "9",      "2020-04-16", "NE",
  "9",      "2020-05-01", "CR"
) %>%
  mutate(PARAMCD = "OVR", ANL01FL = "Y")
pd_obs <-
  bind_rows(tibble::tribble(
    ~USUBJID, ~ADTC,        ~AVALC,
    "6",      "2020-04-12", "Y"
  ) %>%
    mutate(PARAMCD = "PD", ANL01FL = "Y"))
adrs <- bind_rows(ovr_obs, pd_obs) %>%
  mutate(
    ADT = ymd(ADTC),
    STUDYID = "XX1234"
  ) %>%
  select(-ADTC) %>%
  derive_vars_merged(
    dataset_add = adsl,
    by_vars = exprs(STUDYID, USUBJID),
    new_vars = exprs(TRTSDT)
  )
pd_date <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "PD" & ANL01FL == "Y"
)
# Derive confirmed best overall response parameter
derive_param_confirmed_bor(
  adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd_date,
  source_datasets = list(adrs = adrs),
  reference_date = TRTSDT,
  ref_start_window = 28,
  ref_confirm = 28,
  set_values_to = exprs(
    PARAMCD = "CBOR",
    PARAM = "Best Confirmed Overall Response by Investigator"
  )
) %>%
  filter(PARAMCD == "CBOR")
# Derive confirmed best overall response parameter (accepting SD for PR,
# accept two NEs, and considering missings as NE)
derive_param_confirmed_bor(
  adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd_date,
  source_datasets = list(adrs = adrs),
  reference_date = TRTSDT,
  ref_start_window = 28,
  ref_confirm = 28,
  max_nr_ne = 2,
  accept_sd = TRUE,
  missing_as_ne = TRUE,
  set_values_to = exprs(
    PARAMCD = "CBOR",
    PARAM = "Best Confirmed Overall Response by Investigator"
  )
) %>%
  filter(PARAMCD == "CBOR")
Adds a Parameter for Confirmed Response
Description
 The 
derive_param_confirmed_resp()
function has been superseded in favor of derive_extreme_event().
Adds a parameter for confirmed response
Usage
derive_param_confirmed_resp(
  dataset,
  dataset_adsl,
  filter_source,
  source_pd = NULL,
  source_datasets = NULL,
  ref_confirm,
  max_nr_ne = 1,
  accept_sd = FALSE,
  aval_fun,
  set_values_to,
  subject_keys = get_admiral_option("subject_keys")
)
Arguments
| dataset | Input dataset The  After applying  | 
| dataset_adsl | ADSL input dataset The variables specified for  | 
| filter_source | Source filter All observations in  | 
| source_pd | Date of first progressive disease (PD) If the parameter is specified, the observations of the input dataset for deriving the new parameter are restricted to observations up to the specified date. Observations at the specified date are included. For subjects without first PD date all observations are take into account. Permitted Values: a  | 
| source_datasets | Source dataset for the first PD date A named list of datasets is expected. It links the  For example if  pd_date <- date_source( dataset_name = "adrs", date = ADT, filter = PARAMCD == PD ) and the actual response dataset in the script is  | 
| ref_confirm | Minimum time period for confirmation The assessment and the confirmatory assessment for  | 
| max_nr_ne | The specified number of  Permitted Values: a non-negative numeric scalar | 
| accept_sd | Accept  If the argument is set to  Permitted Values: a logical scalar | 
| aval_fun | Deprecated, please use  Function to map character analysis value ( The (first) argument of the function must expect a character vector and the function must return a numeric vector. | 
| set_values_to | Variables to set A named list returned by  | 
| subject_keys | Variables to uniquely identify a subject A list of symbols created using  | 
Details
- The input dataset ( - dataset) is restricted to the observations matching- filter_sourceand to observations before or at the date specified by- source_pd.
- A subject is considered as responder if there is at least one observation in the restricted dataset with -  AVALC == "CR",
- there is a confirmatory assessment with - AVALC == "CR"at least- ref_confirmdays after the assessment,
- all assessments between the assessment and the confirmatory assessment are - "CR"or- "NE", and
- there are at most - max_nr_ne- "NE"assessments between the assessment and the confirmatory assessment.
 - or at least one observation with -  AVALC == "PR",
- there is a confirmatory assessment with - AVALC %in% c("CR", "PR")at least- ref_confirmdays after the assessment,
- all assessments between the assessment and the confirmatory assessment are - "CR",- "PR",- "SD", or- "NE",
- there is no - "PR"assessment after a- "CR"assessment in the confirmation period,
- there are at most - max_nr_ne- "NE"assessments between the assessment and the confirmatory assessment,
- if the - accept_sdargument is set to- TRUE, one- "SD"assessment in the confirmation period is accepted. Otherwise, no- "SD"assessment must occur within the confirmation period.
 
-  
- For responders - AVALCis set to- "Y"and- ADTto the first date where the response criteria are fulfilled. For all other subjects in- dataset_adsl- AVALCis set to- "N"and- ADTto- NA.
- The - AVALvariable is added and set to- aval_fun(AVALC).
- The variables specified by the - set_values_toparameter are added to the new observations.
- The new observations are added to input dataset. 
Value
The input dataset with a new parameter for confirmed response
Author(s)
Stefan Bundfuss
See Also
Other superseded: 
derive_param_bor(),
derive_param_clinbenefit(),
derive_param_confirmed_bor(),
derive_param_response(),
filter_pd()
Examples
library(dplyr)
library(admiral)
# Create ADSL dataset
adsl <- tibble::tribble(
  ~USUBJID, ~TRTSDTC,
  "1",      "2020-01-01",
  "2",      "2019-12-12",
  "3",      "2019-11-11",
  "4",      "2019-12-30",
  "5",      "2020-01-01",
  "6",      "2020-02-02",
  "7",      "2020-02-02",
  "8",      "2020-04-01",
  "9",      "2020-03-01"
) %>%
  mutate(
    STUDYID = "XX1234"
  )
# Create ADRS dataset
ovr_obs <- tibble::tribble(
  ~USUBJID, ~ADTC,        ~AVALC,
  "1",      "2020-01-01", "PR",
  "1",      "2020-02-01", "CR",
  "1",      "2020-02-16", "NE",
  "1",      "2020-03-01", "CR",
  "1",      "2020-04-01", "SD",
  "2",      "2020-01-01", "SD",
  "2",      "2020-02-01", "PR",
  "2",      "2020-03-01", "SD",
  "2",      "2020-03-13", "CR",
  "3",      "2019-11-12", "CR",
  "3",      "2019-12-02", "CR",
  "3",      "2020-01-01", "SD",
  "4",      "2020-01-01", "PR",
  "4",      "2020-03-01", "SD",
  "4",      "2020-04-01", "SD",
  "4",      "2020-05-01", "PR",
  "4",      "2020-05-15", "NON-CR/NON-PD",
  "5",      "2020-01-01", "PR",
  "5",      "2020-01-10", "SD",
  "5",      "2020-01-20", "PR",
  "5",      "2020-05-15", "NON-CR/NON-PD",
  "6",      "2020-02-06", "PR",
  "6",      "2020-02-16", "CR",
  "6",      "2020-03-30", "PR",
  "6",      "2020-04-12", "PD",
  "6",      "2020-05-01", "CR",
  "6",      "2020-06-01", "CR",
  "7",      "2020-02-06", "PR",
  "7",      "2020-02-16", "CR",
  "7",      "2020-04-01", "NE",
  "9",      "2020-03-16", "CR",
  "9",      "2020-04-01", "NE",
  "9",      "2020-04-16", "NE",
  "9",      "2020-05-01", "CR"
) %>%
  mutate(PARAMCD = "OVR", ANL01FL = "Y")
pd_obs <-
  bind_rows(tibble::tribble(
    ~USUBJID, ~ADTC,        ~AVALC,
    "6",      "2020-04-12", "Y"
  ) %>%
    mutate(PARAMCD = "PD", ANL01FL = "Y"))
adrs <- bind_rows(ovr_obs, pd_obs) %>%
  mutate(
    ADT = lubridate::ymd(ADTC),
    STUDYID = "XX1234"
  ) %>%
  select(-ADTC)
pd_date <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "PD" & ANL01FL == "Y"
)
# Derive confirmed response parameter
derive_param_confirmed_resp(
  adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd_date,
  source_datasets = list(adrs = adrs),
  ref_confirm = 28,
  set_values_to = exprs(
    PARAMCD = "CRSP",
    PARAM = "Confirmed Response by Investigator"
  )
) %>%
  filter(PARAMCD == "CRSP")
# Derive confirmed response parameter (accepting SD for PR and two NEs)
derive_param_confirmed_resp(
  adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd_date,
  source_datasets = list(adrs = adrs),
  ref_confirm = 28,
  max_nr_ne = 2,
  accept_sd = TRUE,
  set_values_to = exprs(
    PARAMCD = "CRSP",
    PARAM = "Confirmed Response by Investigator"
  )
) %>%
  filter(PARAMCD == "CRSP")
Adds a Parameter Indicating If a Subject Had a Response before Progressive Disease
Description
 The 
derive_param_response() function has
been superseded in favor of derive_extreme_event().
Adds a parameter indicating if a response has been observed.
If a response has been observed, AVALC is set to "Y", AVAL to 1 and ADT
is set to the
first date when a response has been observed.
If a response has not been observed, AVALC is set to "N", AVAL to 0 and
ADT is set NA.
Usage
derive_param_response(
  dataset,
  dataset_adsl,
  filter_source,
  source_pd = NULL,
  source_datasets = NULL,
  set_values_to,
  aval_fun,
  subject_keys = get_admiral_option("subject_keys")
)
Arguments
| dataset | Input dataset The variables specified by the  After applying  | 
| dataset_adsl | Input dataset 
 | 
| filter_source | Source filter All observations in the  | 
| source_pd | Sources and conditions defining the end of the assessment period for the responses. An object of type  All observations in  
 | 
| source_datasets | Source dataset A named list of datasets with one element is expected
(e.g.  The name must match the  The variables specified by the  | 
| set_values_to | Variables to set A named list returned by  The values must be symbols, character strings, numeric values or  | 
| aval_fun | Deprecated, please use  Function to map character analysis value ( The (first) argument of the function must expect a character vector and the function must return a numeric vector. | 
| subject_keys | Variables to uniquely identify a subject A list of symbols created using  | 
Details
- The Date of the end of the assessment period (e.g. Progressive disease, as defined by - pd_source) is added to the response dataset.
- The response dataset is restricted to observations occurring before or on the date of progressive disease. 
- For each subject (with respect to the variables specified for the - subject_keysparameter), the first observation (with respect to- ADT) where the response condition (- filter_sourceparameter) is fulfilled is selected.
- For each observation in - dataset_adsla new observation is created.- For subjects with a response - AVALCis set to- "Y",- AVALto- 1, and- ADTto the first date (- ADT) where the response condition is fulfilled.
- For all other subjects - AVALCis set to- "N",- AVALto- 0and- ADTto- NA.
 
- The variables specified by the - set_values_toparameter are added to the new observations.
- The new observations are added to input dataset. 
Value
The input dataset with a new parameter indicating if and when a response occurred
Author(s)
Samia Kabi
See Also
Other superseded: 
derive_param_bor(),
derive_param_clinbenefit(),
derive_param_confirmed_bor(),
derive_param_confirmed_resp(),
filter_pd()
Examples
library(dplyr)
library(admiral)
library(lubridate)
library(tibble)
adsl <- tribble(
  ~USUBJID,
  "1",
  "2",
  "3",
  "4"
) %>%
  mutate(STUDYID = "XX1234")
adrs <- tribble(
  ~USUBJID, ~PARAMCD, ~ADTC,         ~AVALC, ~ANL01FL,
  "1",      "OVR",    "2020-01-02",  "PR",   "Y",
  "1",      "OVR",    "2020-02-01",  "CR",   "Y",
  "1",      "OVR",    "2020-03-01",  "CR",   "Y",
  "1",      "OVR",    "2020-04-01",  "SD",   "Y",
  "1",      "PD",     NA_character_, "N",    "Y",
  "2",      "OVR",    "2021-06-15",  "SD",   "Y",
  "2",      "OVR",    "2021-07-16",  "PD",   "Y",
  "2",      "OVR",    "2021-09-14",  "PD",   "Y",
  "2",      "PD",     "2021-09-14",  "Y",    "Y",
  "3",      "OVR",    "2021-09-14",  "SD",   "Y",
  "3",      "OVR",    "2021-10-30",  "PD",   "Y",
  "3",      "OVR",    "2021-12-25",  "CR",   "Y",
  "3",      "PD",     "2021-10-30",  "Y",    "Y"
) %>%
  mutate(
    STUDYID = "XX1234",
    ADT = ymd(ADTC),
    ANL01FL = "Y"
  ) %>%
  select(-ADTC)
# Define the end of the assessment period for responses:
# all responses before or on the first PD will be used.
pd <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "PD" & AVALC == "Y"
)
# Derive the response parameter
derive_param_response(
  dataset = adrs,
  dataset_adsl = adsl,
  filter_source = PARAMCD == "OVR" & AVALC %in% c("CR", "PR") & ANL01FL == "Y",
  source_pd = pd,
  source_datasets = list(adrs = adrs),
  set_values_to = exprs(
    AVAL = yn_to_numeric(AVALC),
    PARAMCD = "RSP",
    PARAM = "Response by investigator"
  ),
  subject_keys = get_admiral_option("subject_keys")
) %>%
  arrange(USUBJID, PARAMCD, ADT)
Filter up to First PD (Progressive Disease) Date
Description
 The 
filter_pd() function has been
superseded in favor of filter_relative().
Filter a dataset to only include the source parameter records up to and including the first PD (progressive disease). These records are passed to downstream derivations regarding responses such as BOR (best overall response).
Usage
filter_pd(
  dataset,
  filter,
  source_pd,
  source_datasets,
  subject_keys = get_admiral_option("subject_keys")
)
Arguments
| dataset | Input dataset The variables  | 
| filter | Filter condition for restricting the input dataset | 
| source_pd | A  For each subject the first date ( | 
| source_datasets | A named list of data sets is expected. The name must match the name provided by the  | 
| subject_keys | Variables to uniquely identify a subject A list of symbols created using  | 
Details
- The input dataset ( - dataset) is restricted by- filter.
- For each subject the first PD date is derived as the first date ( - source_pd$date) in the source pd dataset (- source_datasets[[source_pd$dataset_name]]) restricted by- source_pd$filter.
- The restricted input dataset is restricted to records up to first PD date. Records matching first PD date are included. For subject without any first PD date, all records are included. 
Value
A subset of the input dataset
Author(s)
Teckla Akinyi, Stefan Bundfuss
See Also
Other superseded: 
derive_param_bor(),
derive_param_clinbenefit(),
derive_param_confirmed_bor(),
derive_param_confirmed_resp(),
derive_param_response()
Examples
library(dplyr)
library(lubridate)
library(admiral)
library(admiralonco)
# Filter OVR records up to first PD, first PD date provided in separate BDS dataset (adevent)
adrs <- tibble::tribble(
  ~STUDYID,       ~USUBJID,      ~PARAMCD, ~AVALC, ~ADT,         ~ANL01FL,
  "CDISCPILOT01", "01-701-1015", "OVR",    "CR",   "2016-01-25", "Y",
  "CDISCPILOT01", "01-701-1015", "OVR",    "SD",   "2016-02-22", NA_character_,
  "CDISCPILOT01", "01-701-1015", "OVR",    "PD",   "2016-02-22", "Y",
  "CDISCPILOT01", "01-701-1015", "BOR",    "CR",   "2016-01-25", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "SD",   "2015-12-07", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "PD",   "2016-04-25", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "PD",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1034", "BOR",    "SD",   "2015-12-07", "Y",
  "CDISCPILOT01", "01-701-1035", "OVR",    "SD",   "2016-04-25", "Y",
  "CDISCPILOT01", "01-701-1035", "OVR",    "PR",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1035", "BOR",    "PR",   "2016-06-25", "Y"
) %>% mutate(
  ADT = as_date(ADT)
)
adevent <- tibble::tribble(
  ~STUDYID,       ~USUBJID,      ~PARAMCD, ~AVALC, ~ADT,
  "CDISCPILOT01", "01-701-1015", "PD",     "Y",    "2016-02-22",
  "CDISCPILOT01", "01-701-1034", "PD",     "Y",    "2016-04-25"
) %>% mutate(
  ADT = as_date(ADT)
)
pd <- date_source(
  dataset_name = "adevent",
  date = ADT,
  filter = PARAMCD == "PD"
)
filter_pd(
  dataset = adrs,
  filter = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd,
  source_datasets = list(adevent = adevent)
)
# Filter OVR records up to first PD, first PD date provided in ADSL dataset
adsl <- tibble::tribble(
  ~STUDYID,       ~USUBJID,      ~PDDT,
  "CDISCPILOT01", "01-701-1015", "2016-02-22",
  "CDISCPILOT01", "01-701-1034", "2016-04-25",
  "CDISCPILOT01", "01-701-1035", ""
) %>% mutate(
  PDDT = as_date(PDDT)
)
pd <- date_source(
  dataset_name = "adsl",
  date = PDDT
)
filter_pd(
  dataset = adrs,
  filter = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd,
  source_datasets = list(adsl = adsl)
)
# Filter OVR records up to first PD, first PD date provided in input dataset (PD parameter)
adrs <- tibble::tribble(
  ~STUDYID,       ~USUBJID,      ~PARAMCD, ~AVALC, ~ADT,         ~ANL01FL,
  "CDISCPILOT01", "01-701-1015", "OVR",    "CR",   "2016-01-25", "Y",
  "CDISCPILOT01", "01-701-1015", "OVR",    "SD",   "2016-02-22", NA_character_,
  "CDISCPILOT01", "01-701-1015", "OVR",    "PD",   "2016-02-22", "Y",
  "CDISCPILOT01", "01-701-1015", "BOR",    "CR",   "2016-01-25", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "SD",   "2015-12-07", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "PD",   "2016-04-25", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "PD",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1034", "BOR",    "SD",   "2015-12-07", "Y",
  "CDISCPILOT01", "01-701-1035", "OVR",    "SD",   "2016-04-25", "Y",
  "CDISCPILOT01", "01-701-1035", "OVR",    "PR",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1035", "BOR",    "PR",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1015", "PD",     "Y",    "2016-02-22", "Y",
  "CDISCPILOT01", "01-701-1034", "PD",     "Y",    "2016-04-25", "Y"
) %>% mutate(
  ADT = as_date(ADT)
)
pd <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "PD"
)
filter_pd(
  dataset = adrs,
  filter = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd,
  source_datasets = list(adrs = adrs)
)
# Filter OVR records up to first PD, first PD date derived from OVR records
adrs <- tibble::tribble(
  ~STUDYID,       ~USUBJID,      ~PARAMCD, ~AVALC, ~ADT,         ~ANL01FL,
  "CDISCPILOT01", "01-701-1015", "OVR",    "CR",   "2016-01-25", "Y",
  "CDISCPILOT01", "01-701-1015", "OVR",    "SD",   "2016-02-22", NA_character_,
  "CDISCPILOT01", "01-701-1015", "OVR",    "PD",   "2016-02-22", "Y",
  "CDISCPILOT01", "01-701-1015", "BOR",    "CR",   "2016-01-25", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "SD",   "2015-12-07", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "PD",   "2016-04-25", "Y",
  "CDISCPILOT01", "01-701-1034", "OVR",    "PD",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1034", "BOR",    "SD",   "2015-12-07", "Y",
  "CDISCPILOT01", "01-701-1035", "OVR",    "SD",   "2016-04-25", "Y",
  "CDISCPILOT01", "01-701-1035", "OVR",    "PR",   "2016-06-25", "Y",
  "CDISCPILOT01", "01-701-1035", "BOR",    "PR",   "2016-06-25", "Y"
) %>% mutate(
  ADT = as_date(ADT)
)
pd <- date_source(
  dataset_name = "adrs",
  date = ADT,
  filter = PARAMCD == "OVR" & ANL01FL == "Y" & AVALC == "PD"
)
filter_pd(
  dataset = adrs,
  filter = PARAMCD == "OVR" & ANL01FL == "Y",
  source_pd = pd,
  source_datasets = list(adrs = adrs)
)
Get CR Records Followed by PR That Lead to a Prior Error
Description
Get CR Records Followed by PR That Lead to a Prior Error
Usage
get_crpr_dataset()
Details
Some {admiralonco} functions check that in the source records CR is not
followed by PR and throw an error otherwise. The get_crpr_dataset()
function allows one to retrieve the duplicate records that lead to an error.
Note that the function always returns the dataset of duplicates from the last
error that has been thrown in the current R session. Thus, after restarting
the R sessions get_crpr_dataset() will return NULL and after a second
error has been thrown, the dataset of the first error can no longer be
accessed (unless it has been saved in a variable).
Value
A data.frame or NULL
Author(s)
Stefan Bundfuss
See Also
Utilities for Dataset Checking: 
signal_crpr()
Examples
library(tibble)
library(dplyr)
library(lubridate)
library(admiralonco)
library(rlang)
adrs <- tribble(
  ~USUBJID, ~ADTC,        ~AVALC,
  "1",      "2020-01-01", "PR",
  "1",      "2020-02-01", "CR",
  "1",      "2020-02-16", "NE",
  "1",      "2020-03-01", "CR",
  "2",      "2020-02-06", "PR",
  "2",      "2020-02-16", "CR",
  "2",      "2020-03-30", "PR",
) %>%
  mutate(
    ADT = ymd(ADTC),
    STUDYID = "XX1234"
  )
signal_crpr(adrs, order = exprs(ADT))
get_crpr_dataset()
Pre-Defined Response Event Objects
Description
These pre-defined event() and event_joined() objects can be used as input
to admiral::derive_extreme_event().
Usage
rsp_y
no_data_n
cb_y
bor_cr
bor_pr
bor_sd
bor_non_crpd
bor_pd
bor_ne
no_data_missing
crsp_y_cr
crsp_y_pr
cbor_cr
cbor_pr
Details
To see the definition of the various objects simply print the object in the
R console, e.g. bor_sd. For details of how to use these objects
please refer to admiral::derive_extreme_event().
It is assumed that dataset_name = "ovr" refers to the dataset of the only
overall response assessments at each visit which should be considered for the
parameter derivations. For example the dataset should include only
post-baseline assessments up to first PD and before start of anti-cancer
therapy.
See Also
admiral::derive_extreme_event(), admiral::event(), admiral::event_joined()
Examples
# This shows the definition of all pre-defined `event` objects that ship
# with {admiralonco}
exports <- sort(getNamespaceExports("admiralonco"))
for (obj_name in exports) {
  obj <- getExportedValue("admiralonco", obj_name)
  if (inherits(obj, "event_def")) {
    cat("\n", obj_name, ":\n", sep = "")
    print(obj, indent = 2)
  }
}
Signal CR Records Followed by PR
Description
Signal CR Records Followed by PR
Usage
signal_crpr(
  dataset,
  order,
  msg = "Dataset contains CR records followed by PR.",
  subject_keys = get_admiral_option("subject_keys"),
  check_type = "warning"
)
Arguments
| dataset | A data frame | 
| order | A list of variables created using  | 
| msg | The condition message | 
| subject_keys | Variables to uniquely identify a subject A list of symbols created using  | 
| check_type | Type of message to issue when detecting PR after CR. Permitted Values:  | 
Value
No return value, called for side effects
Author(s)
Stefan Bundfuss
See Also
Utilities for Dataset Checking: 
get_crpr_dataset()
Examples
library(tibble)
library(dplyr)
library(lubridate)
library(admiralonco)
library(rlang)
adrs <- tribble(
  ~USUBJID, ~ADTC,        ~AVALC,
  "1",      "2020-01-01", "PR",
  "1",      "2020-02-01", "CR",
  "1",      "2020-02-16", "NE",
  "1",      "2020-03-01", "CR",
  "2",      "2020-02-06", "PR",
  "2",      "2020-02-16", "CR",
  "2",      "2020-03-30", "PR",
) %>%
  mutate(
    ADT = ymd(ADTC),
    STUDYID = "XX1234"
  )
signal_crpr(adrs, order = exprs(ADT))