Skip to contents

admiral 0.8.4

CRAN release: 2022-10-14

  • Fixed a bug where a recent update to {lifecylce} caused several admiral tests to break (#1500)

admiral 0.8.3

CRAN release: 2022-10-07

  • Second attempt to address issue where CRAN identified a failing test when “a strict Latin-1* locale” is used (#1469)
  • Fixed a bug in derive_vars_duration() that surfaced after changes in R-devel (#1486)

admiral 0.8.2

CRAN release: 2022-09-29

  • Fixed an issue where CRAN identified a failing test when “a strict Latin-1* locale” is used (#1469)

admiral 0.8.1

CRAN release: 2022-09-20

admiral 0.8.0

CRAN release: 2022-09-05

New Features

Updates of Existing Functions

  • list_tte_source_objects() gains a package parameter and is now exported (#1212)

  • list_all_templates() and use_ad_template() gain a package parameter which can be used to indicate in which package to look for templates (#1205)

  • Randomization Date RANDDT variable added to ADSL template and vignette (#1126)

  • Renamed derive_derived_param() to derive_param_computed() and added a deprecation notice (#1229)

  • derive_vars_duration() updated to not display units when there is missing duration (#1207)

  • value_var parameter added to derive_vars_atc() (#1120)

  • format_eoxxstt_default() - Updated the default value of EOSSTT for screen failure patients (#885)

  • The imputation functions (derive_vars_dtm(), derive_vars_dt(), convert_dtc_to_dtm(), convert_dtc_to_dt()) have been enhanced to address users feedback (#1300):

    • Partial dates with missing components in the middle like "2003-12-15T-:15:18", "2003-12-15T13:-:19", "2020-07--T00:00" are handled now.

    • The control of the level of imputation has been refined by adding the highest_imputation argument. For example, highest_imputation = "D" requests imputation for day and time but not for year and month.

      (For the date_imputation and the time_imputation argument NULL is no longer a permitted value.)

    • It is now possible to impute completely missing dates by specifying highest_imputation = "Y" and the min_dates or max_dates argument.

  • order parameter added to dthcaus_source() which allows an additional character vector to be used for sorting the dataset, derive_vars_dthcaus() updated to process additional parameter (#1125).

  • create_single_dose_dataset() Fixed bug where ASTDTM and AENDTM were not updated when start_date = ASTDT and end_date = AENDT. The function has been amended to now require start_datetime and end_datetime parameters in addition to start_date and end_date.The keep_source_vars has been added to specify the variables to be retained from the source dataset (#1224)

Breaking Changes



  • Restructured Reference page and updated all functions to use family tag in roxygen headers for finding similar functions. (#1105)

  • Rename “Articles” page on website to “User Guides” and moved developer vignettes to admiraldev website (#1356)

admiral 0.7.1

CRAN release: 2022-07-18

  • derive_vars_last_dose() no longer fails when a variable renamed in new_vars is supplied to the dose_date parameter (#1206)

  • derive_vars_duration() updated to not display units when there is missing duration (#1207)

  • derive_param_first_event() was updated (#1214) such that

    • AVAL is derived instead of AVALN and
    • all variables from the source dataset are kept.
  • create_single_dose_dataset() Fixed bug where ASTDTM and AENDTM were not updated when start_date=ASTDT and end_date=AENDT. The function has been amended to now require start_datetime and end_datetime parameters in addition to start_date and end_date.The keep_source_vars has been added to specify the variables to be retained from the source dataset.

  • slice_derivation() was updated such that it no longer fails if a slice is empty (#1309)

admiral 0.7.0

CRAN release: 2022-05-31

New Features



  • New ADPP template script available ad_adpp.R which creates Pharmacokinetics Parameters Analysis Dataset (#850)

Updates of Existing Functions

  • Datasets internal to the package have been renamed with prefix admiral_, e.g. adsl has been renamed to admiral_adsl. Corresponding SDTM datasets in {admiral.test} have also been renamed, to admiral_dm. These changes will impact examples, vignettes, unit tests and templates (#1108 and #1088)

  • When derive_vars_dtm_to_tm() was called for variables created by derive_vars_dtm() the function failed. This bug was fixed (#1097).

  • impute_dtc() - Fixed imputation bug. A user setting date_imputation = MID and preserve = FALSE would expect the date 2019---07 to be imputed to 2019-06-30, but the function was returning 2019-06-15. Now returns it correctly. This bug fix also addresses the issue in the downstream functions derive_vars_dt() and derive_vars_dtm(). (#1081)

  • format_eoxxstt_default() - Updated to have a more meaningful parameter name i.e. the parameter that was x is now status (#911)

Breaking Changes

  • derive_var_lstalvdt() has been deprecated in favor of derive_var_extreme_dt() (#753).

  • derive_vars_disposition_reason() now is updated such that the default is populating DCSREASP only when DSDECOD is equal to 'OTHER', which is consistent with ADaMIG_v1.3 (#886).

  • derive_vars_suppqual() has been removed from {admiral} as adding supplementary qualifiers is now done in another package called {metatools} in a function called combine_supp() and is available on CRAN (#950)

  • The filter parameter in derive_var_extreme_flag() and derive_var_worst_flag() has been deprecated in favor of restrict_derivation() (#701).

  • The following functions and parameters, which were deprecated in previous {admiral} versions, have been removed (#1056):

    • derive_agegr_ema()
    • derive_agegr_fda()
    • derive_disposition_dt()
    • derive_disposition_status()
    • derive_extreme_flag()
    • derive_worst_flag()
    • derive_obs_number()
    • derive_disposition_reason()
    • derive_var_basec()
    • derive_baseline()
    • derive_params_exposure()
    • derive_last_dose()
    • dataset parameter in lstalvdt_source and dthcaus_source
  • The following functions were deprecated in favor of derive_vars_dy() (#1076):

  • The following functions were deprecated in favor of derive_vars_merged_dtm() (#1076):

    • derive_var_trtedtm() - Derive Datetime of Last Exposure to Treatment
    • derive_var_trtsdtm() - Derive Datetime of First Exposure to Treatment
  • The derive_var_disposition_dt() function was deprecated in favor of derive_vars_merged_dt() (#1076)

  • The derive_var_atirel() function was deprecated, as it is deemed as too specific for admiral. Derivations like this can be implemented calling mutate() and case_when().



  • Naming convention of packages change to admiralxxx from this point onwards (#968)

admiral 0.6.3

CRAN release: 2022-02-17

Address CRAN comments raised after submitting v0.6.2 (#946)

admiral 0.6.2

Address CRAN comments raised after submitting v0.6.1 (#925)

admiral 0.6.1

Address CRAN comments raised after submitting v0.6.0 (#918)

admiral 0.6.0

New Features

Updates of Existing Functions

Breaking Changes


  • README and site homepage has been updated with important new section around expectations of {admiral}, as well as other useful references such as links to conference talks (#868 & #802)

  • New vignette Development Process and improvements made to contribution vignettes (#765 & #758)

  • Updated Pull Request Review Guidance on using task-list-completed workflow (#817)


  • GitHub repo moved to pharmaverse org and associated broken site links fixed (#803 & #820)

  • Examples have been added for format_reason_default, format_eoxxstt_default, extend_source_datasets and filter_date_sources (#745)

admiral 0.5.0

admiral 0.4.0

New Features




  • assert_list_element() checks if an element of a list of lists/classes fulfills a condition

  • assert_one_to_one() checks if there is a one to one mapping between two lists of variables

  • negate_vars() negates a list of variables to remove them from a dataset with select()

Updates of Existing Functions

  • Unit checks in derive_param_*() functions are no longer case sensitive (#631)

  • derive_agegr_ema() and derive_agegr_fda() gain a age_unit parameter used to specify the unit of the input age (#569)

Breaking Changes

Bug Fixes


admiral 0.3.0

New Features


  • convert_blanks_to_na() can be used to convert SAS blanks, i.e. "", into proper R NA values (#482)

  • call_derivation() enables users to call the same function multiple times with some parameters being fixed across iterations and others varying (#403)

  • derive_vars_dtm_to_dt() enables the easy conversion of datetime to date variables (#376)

  • derive_var_ontrtfl() can now handle events with a start and end date rather than just a single assessment date (#395)

  • derive_worst_flag() enables the flagging of worst records (#300)



Updates of Existing Functions

  • derive_var_anrind() now checks whether the AVAL variable is present in the input dataset (#486)

  • All derivation functions check whether the input dataset is grouped and throw an error if it is (#408)

  • use_ad_template() has been refactored to no longer make use of the {usethis} package which is no longer a dependency of {admiral} (#433)

  • A performance issue in derive_vars_dt() has been resolved (#384)

Breaking Changes

  • The drop_values_from parameter has been removed from derive_summary_records() (#425)

  • The format of the date_imputation parameter of derive_vars_dt() and derive_vars_dtm() has been changed from “dd-mm” to “mm-dd”. Thus, “01-12” now refers to January 12th rather than December 1st (#492)

  • Several functions have been renamed. The old names are now deprecated. They can still be used but a warning will be issued (#507)

  • The date_var parameter of lstalvdt_source() has been renamed to date

  • The filter_rows parameter of derive_summary_records() has been renamed to filter. The fns parameter has been deprecated in favor of analysis_var and summary_fun (#491)

  • The date_var and traceabilty_vars parameters of dthcaus_source() have been renamed to date and traceability_vars, respectively (#493)

  • The flag_filter parameter of derive_extreme_flag() has been renamed to filter (#487)

Bug Fixes

  • derive_agegr_fda() used to return NA for ages less than or equal 18. It now returns <=18 (#441)


  • New vignette on “Date and Time Imputation” has been created (#198)

  • A “Guidance for git Usage” has been created (#266)

  • “OCCDS” has been added as a new section on the reference page on the package website (#485)

  • The Programming Strategy has been updated (#495)

  • A search feature has been added to the package website (#438)

  • New template scripts for ADEX (#181), ADCM (#268) and ADEG (#258) have been created

  • New vignette for programming ADEX has been created (#372)

  • A section on how to create query variables (e.g. SMQs in ADAE) has been added to the Occurrence datasets vignette (#370)

  • The BDS vignette has been updated to incorporate examples of ADVS and ADEG specific functions (#371)

admiral 0.2.1

admiral 0.2.0

New Features


  • Function argument checks have been completely re-written to provide clearer error messages to users (#263, #288)

  • SDTM SUPP-- datasets can be merged onto their parent domain using derive_suppqual_vars() (#145)

  • In case a derivation detects duplicate records after applying a filter, the dataset of duplicate records is made available to users via get_duplicates_dataset() (#202)

  • derive_vars_dt() and derive_vars_dtm() gain a min_dates and max_dates parameter which can be used to ensure that the imputed date(time) is not before the min_dates nor after the max_dates, e.g. avoid that AENDT is after the data cut date or ASTDT is before the first treatment date (#158)

  • use_ad_template() can be used to open a template script for an ADaM dataset; all available templates can be displayed using list_all_templates() (#110)


  • EMA and FDA defined age groupings can be derived using derive_agegr_ema() and derive_agegr_fda(), respectively

  • Disposition Status can be derived using derive_disposition_status() (#92)

  • Disposition Reason can be derived using derive_disposition_reason()

  • Disposition Dates can be derived using derive_disposition_dt() (#91)

  • Date Last Known Alive can be derived using derive_var_lstalvdt() (#94)

  • Cause of Death can be derived using derive_var_dthcaus() (#93)



  • Last Dose Date(time) can be derived using derive_last_dose()

Breaking Changes

  • derive_merged_vars() has been removed from {admiral} in favor of smaller special purpose functions, e.g. derive_disposition_status() (#167)

  • Function arguments no longer accept expressions created with expr() or exprs() as inputs; instead filter expressions can be passed “as is” and multiple variables have to be wrapped inside vars() (#187)


      new_var = LASTFL,
      by_vars = exprs(USUBJID, VSTESTCD, VISIT),
      order = exprs(VSTPTNUM),
      mode = "last",
      flag_filter = expr(VISIT != "BASELINE")


      new_var = LASTFL,
      by_vars = vars(USUBJID, VSTESTCD, VISIT),
      order = vars(VSTPTNUM),
      mode = "last",
      flag_filter = VISIT != "BASELINE"
  • read_dap_m3() and initialize() have been migrated to {admiral.roche} (#272)

  • The start_date and end_date parameters of derive_var_ady(), derive_var_aendy() and derive_var_astdy() have been renamed to reference_date and date, respectively (#121)

Bug Fixes

  • derive_var_basetype() no longer drops records which do not match any condition defined in the basetype argument (#226)

  • Join warnings like “Column USUBJID has different attributes on LHS and RHS of join when using left_join()” are no longer displayed (#271)

  • For datetimes with time imputed to “00:00:00” the time part is now displayed (#206)