Skip to contents

Derivations for Adding Variables

All ADaMs

derive_var_extreme_flag()
Add a Variable Flagging the First or Last Observation Within Each By Group
derive_var_joined_exist_flag()
Derives a Flag Based on an Existing Flag
derive_var_merged_ef_msrc()
Merge an Existence Flag From Multiple Sources
derive_var_merged_exist_flag()
Merge an Existence Flag
derive_var_merged_summary()
Merge Summary Variables
derive_var_obs_number()
Adds a Variable Numbering the Observations Within Each By Group
derive_var_relative_flag()
Flag Observations Before or After a Condition is Fulfilled
derive_var_trtdurd()
Derive Total Treatment Duration (Days)
derive_vars_cat()
Derive Categorization Variables Like AVALCATy and AVALCAyN
derive_vars_computed()
Adds Variable(s) Computed from the Analysis Value of one or more Parameters
derive_vars_dt()
Derive/Impute a Date from a Date Character Vector
derive_vars_dtm()
Derive/Impute a Datetime from a Date Character Vector
derive_vars_dtm_to_dt()
Derive Date Variables from Datetime Variables
derive_vars_dtm_to_tm()
Derive Time Variables from Datetime Variables
derive_vars_duration()
Derive Duration
derive_vars_dy()
Derive Relative Day Variables
derive_vars_joined()
Add Variables from an Additional Dataset Based on Conditions from Both Datasets
derive_vars_merged()
Add New Variable(s) to the Input Dataset Based on Variables from Another Dataset
derive_vars_merged_lookup()
Merge Lookup Table with Source Dataset
derive_vars_transposed()
Derive Variables by Transposing and Merging a Second Dataset

ADSL-specific

Derivation functions helpful for building the ADSL dataset

derive_var_age_years()
Derive Age in Years
derive_vars_aage()
Derive Analysis Age
derive_vars_extreme_event()
Add the Worst or Best Observation for Each By Group as New Variables
derive_vars_period()
Add Subperiod, Period, or Phase Variables to ADSL

BDS-specific

Derivation functions helpful for building the BDS datasets (e.g. advs, adlb, adeg, adex)

derive_basetype_records()
Derive Basetype Variable
derive_var_analysis_ratio()
Derive Ratio Variable
derive_var_anrind()
Derive Reference Range Indicator
derive_var_atoxgr()
Derive Lab High toxicity Grade 0 - 4 and Low Toxicity Grades 0 - (-4)
derive_var_atoxgr_dir()
Derive Lab Toxicity Grade 0 - 4
derive_var_base()
Derive Baseline Variables
derive_var_chg()
Derive Change from Baseline
derive_var_ontrtfl()
Derive On-Treatment Flag Variable
derive_var_pchg()
Derive Percent Change from Baseline
derive_var_shift()
Derive Shift
derive_vars_crit_flag()
Derive Criterion Flag Variables CRITy, CRITyFL, and CRITyFN

OCCDS-specific

Derivation functions helpful for building the OCCDS datasets (e.g. adae, adcm, admh)

derive_var_trtemfl()
Derive Treatment-emergent Flag
derive_vars_atc()
Derive ATC Class Variables
derive_vars_query()
Derive Query Variables
get_terms_from_db()
Get Terms from the Queries Database

Derivations for Adding Parameters/Records

BDS-specific

default_qtc_paramcd()
Get Default Parameter Code for Corrected QT
derive_expected_records()
Derive Expected Records
derive_extreme_event()
Add the Worst or Best Observation for Each By Group as New Records
derive_extreme_records()
Add the First or Last Observation for Each By Group as New Records
derive_locf_records()
Derive LOCF (Last Observation Carried Forward) Records
derive_param_bmi()
Adds a Parameter for BMI
derive_param_bsa()
Adds a Parameter for BSA (Body Surface Area) Using the Specified Method
derive_param_computed()
Adds a Parameter Computed from the Analysis Value of Other Parameters
derive_param_doseint()
Adds a Parameter for Dose Intensity
derive_param_exist_flag()
Add an Existence Flag Parameter
derive_param_exposure()
Add an Aggregated Parameter and Derive the Associated Start and End Dates
derive_param_framingham()
Adds a Parameter for Framingham Heart Study Cardiovascular Disease 10-Year Risk Score
derive_param_map()
Adds a Parameter for Mean Arterial Pressure
derive_param_qtc()
Adds a Parameter for Corrected QT (an ECG measurement)
derive_param_rr()
Adds a Parameter for Derived RR (an ECG measurement)
derive_param_wbc_abs()
Add a parameter for lab differentials converted to absolute values
derive_summary_records()
Add New Records Within By Groups Using Aggregation Functions

TTE-specific

derive_param_tte()
Derive a Time-to-Event Parameter

Metadata

Auxiliary datasets providing definitions as input for derivations, e.g. grading criteria or dose frequencies

atoxgr_criteria_ctcv4
Metadata Holding Grading Criteria for NCI-CTCAEv4
atoxgr_criteria_ctcv5
Metadata Holding Grading Criteria for NCI-CTCAEv5
atoxgr_criteria_daids
Metadata Holding Grading Criteria for DAIDs
country_code_lookup
Country Code Lookup
dose_freq_lookup
Pre-Defined Dose Frequencies

Example Datasets

You can run use_ad_template() to produce additional datasets

admiral_adlb
Lab Analysis Dataset
admiral_adsl
Subject Level Analysis Dataset
ex_single
Single Dose Exposure Dataset
example_qs
Example QS Dataset
queries
Queries Dataset
queries_mh
Queries MH Dataset

Advanced Functions

Admiral Options

get_admiral_option()
Get the Value of an Admiral Option
set_admiral_options()
Set the Value of admiral Options

Higher Order

call_derivation()
Call a Single Derivation Multiple Times
derivation_slice()
Create a derivation_slice Object
restrict_derivation()
Execute a Derivation on a Subset of the Input Dataset
slice_derivation()
Execute a Derivation with Different Arguments for Subsets of the Input Dataset

Creating Auxiliary Datasets

consolidate_metadata()
Consolidate Multiple Meta Datasets Into a Single One
create_period_dataset()
Create a Reference Dataset for Subperiods, Periods, or Phases
create_query_data()
Creates a queries dataset as input dataset to the dataset_queries argument in derive_vars_query()
create_single_dose_dataset()
Create dataset of single doses

Source Objects

basket_select()
Create a basket_select object
censor_source()
Create a censor_source Object
event()
Create a event Object
event_joined()
Create a event_joined Object
event_source()
Create an event_source Object
flag_event()
Create a flag_event Object
query()
Create an query object
records_source()
Create a records_source Object
tte_source()
Create a tte_source Object
death_event lastalive_censor ae_event ae_ser_event ae_gr1_event ae_gr2_event ae_gr3_event ae_gr4_event ae_gr5_event ae_gr35_event ae_sev_event ae_wd_event
Pre-Defined Time-to-Event Source Objects

Other

list_tte_source_objects()
List all tte_source Objects Available in a Package
params()
Create a Set of Parameters

Computation Functions for Vectors

All ADaMs

compute_age_years()
Compute Age in Years
compute_dtf()
Derive the Date Imputation Flag
compute_duration()
Compute Duration
compute_tmf()
Derive the Time Imputation Flag
convert_date_to_dtm()
Convert a Date into a Datetime Object
convert_dtc_to_dt()
Convert a Date Character Vector into a Date Object
convert_dtc_to_dtm()
Convert a Date Character Vector into a Datetime Object
impute_dtc_dt()
Impute Partial Date Portion of a '--DTC' Variable
impute_dtc_dtm()
Impute Partial Date(-time) Portion of a '--DTC' Variable

BDS-specific

compute_bmi()
Compute Body Mass Index (BMI)
compute_bsa()
Compute Body Surface Area (BSA)
compute_egfr()
Compute Estimated Glomerular Filtration Rate (eGFR) for Kidney Function
compute_framingham()
Compute Framingham Heart Study Cardiovascular Disease 10-Year Risk Score
compute_map()
Compute Mean Arterial Pressure (MAP)
compute_qtc()
Compute Corrected QT
compute_qual_imputation()
Function to Impute Values When Qualifier Exists in Character Result
compute_qual_imputation_dec()
Compute Factor for Value Imputations When Character Value Contains < or >
compute_rr()
Compute RR Interval From Heart Rate
compute_scale()
Compute Scale Parameters
transform_range()
Transform Range

Utility Functions

Utilities for Formatting Observations

convert_blanks_to_na()
Convert Blank Strings Into NAs
convert_na_to_blanks()
Convert NAs Into Blank Strings
yn_to_numeric()
Map "Y" and "N" to Numeric Values

Utilities for Dataset Checking

get_duplicates_dataset()
Get Duplicate Records that Led to a Prior Error
get_many_to_one_dataset()
Get Many to One Values that Led to a Prior Error
get_one_to_many_dataset()
Get One to Many Values that Led to a Prior Error

Utilities used within Derivation Functions

call_user_fun()
Calls a Function Provided by the User
extract_unit()
Extract Unit From Parameter Description
get_flagged_records()
Create an Existence Flag
get_not_mapped()
Get list of records not mapped from the lookup table.
get_vars_query()
Get Query Variables

Utilities for Filtering Observations

count_vals()
Count Number of Observations Where a Variable Equals a Value
filter_exist()
Returns records that fit into existing by groups in a filtered source dataset
filter_extreme()
Filter the First or Last Observation for Each By Group
filter_joined()
Filter Observations Taking Other Observations into Account
filter_not_exist()
Returns records that don't fit into existing by groups in a filtered source dataset
filter_relative()
Filter the Observations Before or After a Condition is Fulfilled
max_cond()
Maximum Value on a Subset
min_cond()
Minimum Value on a Subset

Utilities for Quosures

chr2vars()
Turn a Character Vector into a List of Expressions
negate_vars()
Negate List of Variables

Utilities used for Examples and Template Scripts

list_all_templates()
List All Available ADaM Templates
use_ad_template()
Open an ADaM Template Script

Objects exported from other packages

To maximize the user-friendliness of admiral, functions from other packages are provided without changes made to them, follow the links below to see their documentation.

`%>%`
Pipe operator
desc
dplyr desc
exprs
rlang exprs

Deprecated

Functions and arguments may need to be removed or replaced over time. In such cases, the function or argument will enter a 3 year deprecation cycle. The cycle will be tied as close as sensibly possible to a package release.

When a function is deprecated:

  • In Year 1, there will be a message issued if you use the function/argument, but it will still be available to use.
  • In Year 2, a warning will be produced if you use the function/argument, but it will still be available to use.
  • In Year 3, an error will be produced if you use the function/argument and no longer be able to use.
  • Finally, after 3 years, the function/argument and related documentation and tests will be removed from admiral.

Note: Guidance on replacement functionality will be found in the message produced as well as in the function’s documentation.

Below, you can find a list of functions in the process of being deprecated:

date_source() deprecated
Create a date_source object
derive_param_extreme_record() deprecated
Adds a Parameter Based on First or Last Record from Multiple Sources
derive_var_dthcaus() deprecated
Derive Death Cause
derive_var_extreme_dt() deprecated
Derive First or Last Date from Multiple Sources
derive_var_extreme_dtm() deprecated
Derive First or Last Datetime from Multiple Sources
dthcaus_source() deprecated
Create a dthcaus_source Object
get_summary_records() deprecated
Create Summary Records