Releases: pharmaverse/admiral
admiral 0.11.0
admiral 0.11.0
New Features
-
In the function
derive_var_anrind()
, added argumentuse_a1hia1lo
to turn the usage ofA1HI
andA1LO
off and on, with the default being off. (#1795) -
Added a "Report a bug" link to
{admiral}
website. (#1836) -
New function
compute_age_years()
for converting a vector of age values to years. (#1794) -
New functions
filter_exist()
andfilter_not_exist()
for selecting records from
a dataset dependent on the existence of the corresponding by groups in a filtered
source dataset. (#1699) -
New function
derive_param_extreme_record()
that adds parameter based on the first or last record from multiple sources. (#1822) -
New ADPPK template script available
ad_adppk.R
which creates Population PK Analysis Dataset based on forthcoming CDISC Implementation guide. (#1772) -
New function
compute_egfr()
for calculating Estimated Glomerular Filtration Rate (eGFR) and Creatinine Clearance for Kidney Function. (#1826)
Updates of Existing Functions
-
derive_extreme_records()
was enhanced such that it includes the
functionality ofderive_param_extreme_event()
. (#1725) -
For the
set_values_to
argument expressions are accepted now. For example,
set_values_to = exprs(PARAMCD = str_to_upper(QSTESTCD))
. This affects
censor_source()
,derive_expected_records()
,derive_extreme_event()
,
derive_extreme_records()
,derive_param_bmi()
,derive_param_bsa()
,
derive_param_computed()
,derive_param_doseint()
,derive_param_exposure()
,
derive_param_framingham()
,derive_param_map()
,derive_param_exist_flag()
,
derive_param_extreme_event()
,derive_param_qtc()
,derive_param_rr()
,
derive_param_wbc_abs()
,derive_summary_records()
,event_source()
,
get_summary_records()
. (#1727) -
For the
order
argument expressions are accepted now. (#1727) -
derive_vars_merged()
updates: (#1727)- The
missing_values
argument to assign values to
the new variables for non-matching observations was added. - The
new_vars
argument accepts expressions now.
- The
-
derive_vars_joined()
updates: (#1727)- The
missing_values
argument to assign values to the new variables for
non-matching observations was added. - The
new_vars
and thejoin_vars
argument accept expressions now.
- The
-
The
date
field ofdate_source()
accepts expressions now. This affects
derive_var_extreme_dt()
andderive_var_extreme_dtm()
. (#1727) -
The
date
anddthcaus
field ofdthcaus_source()
accept expressions now.
This affectsderive_var_dthcaus()
. (#1727) -
The
date
field ofevent_source()
andcensor_source()
accepts expressions
now. This affectsderive_param_tte()
. (#1727) -
The
derive_param_computed()
function was enhanced: (#1873)- The new
dataset_add
argument allows to consider parameters from a
different dataset than the input dataset. - The new
analysis_var
argument allows to specify the variable to be
populated, e.g.,AVALC
. - For
parameters
andconstant_parameters
a list of expressions can be
specified now. This allows to create temporary parameter codes, e.g., if
SDTM data is used as input. - The
analysis_value
argument was enhanced such that any variable of the
form<variable>.<parameter>
can be used, e.g.,QSORRES.CHSF13
.
- The new
Breaking Changes
-
create_query_data()
andderive_vars_query()
updated to rename variables in
query data set as follows: (#1907)VAR_PREFIX
toPREFIX
QUERY_NAME
toGRPNAME
QUERY_ID
toGRPID
QUERY_SCOPE
toSCOPE
QUERY_SCOPE_NUM
toSCOPEN
TERM_LEVEL
toSRCVAR
TERM_NAME
toTERMNAME
TERM_ID
toTERMID
Users need to adjust their
get_terms()
function accordingly. -
The
aval_fun
argument ofderive_param_exist_flag()
was deprecated in favor
of theset_values_to
argument. (#1727) -
derive_var_merged_cat()
andderive_var_merged_character()
have been
deprecated in favor ofderive_vars_merged()
. (#1727) -
The following functions, which were deprecated in previous
{admiral}
versions, have been removed: (#1747)derive_vars_merged_dt()
derive_vars_merged_dtm()
derive_var_agegr_ema()
derive_var_agegr_fda()
derive_param_first_event()
derive_derived_param()
derive_var_confirmation_flag()
filter_confirmation()
-
The following functions have been deprecated from previous
{admiral}
versions using the next phase of the deprecation process: (#1747)derive_var_disposition_status()
derive_vars_disposition_reason()
format_eoxxstt_default()
format_reason_default()
derive_var_worst_flag()
-
derive_param_extreme_event()
was deprecated in favor of
derive_extreme_records()
. (#1725) -
The
filter
argument inderive_extreme_records()
was deprecated in favor of
thefilter_add
argument. (#1725) -
derive_vars_last_dose()
,derive_var_last_dose_amt()
,derive_var_last_dose_date()
,derive_var_last_dose_grp()
,
were deprecated in favor ofderive_vars_joined()
. (#1797) -
derive_var_basetype()
was deprecated in favor ofderive_basetype_records()
. (#1796) -
In the function
derive_param_exist_flag()
the argumentsdataset_adsl
and
subject_keys
have been renamed todataset_ref
andby_vars
respectively. (#1793)
Documentation
-
Updated example dataset to trigger deterioration flags in the vignette "Creating Questionnaire ADaMs". (#1853, #1854)
-
Updated PK Programming vignette to include new Population PK Template
ad_adppk.R
. (#1772) -
Updated "Lab Grading" Vignette to link to grading metadata available in
{admiral}
and clarify how abnormal baseline
values are assigned in NCI-CTCAEv5. (#1863) -
Updated "Visit and Period Variables" Vignette to add more detail about Study Specific Code that is required. (#1831)
-
Increased documentation for those functions which are regarded as wrapper functions. (#1726)
-
Examples in function documentation no longer rely on
library(admiral.test)
. (#1752) -
Conferences where
{admiral}
was presented were updated on theREADME.md
. (#1890)
Various
-
vars()
which was used in the admiral function calls that expected a list of
quosures has been removed. The admiral optionforce_admiral_vars
was removed
as well. (#1694) -
derive_vars_dtm()
andderive_vars_dt()
had a bug pertaining to imputations associated with supplying bothmin_dates
andmax_dates
that has now been resolved. (#1843) -
Examples for
derive_var_extreme_flag()
were reworked to reduce runtime that occasionally led to failing CI check. (#1780) -
create_period_dataset()
had a bug that led to an error when both DT and DTM columns existed. (#1845) -
External functions are now consistently imported via namespace.
package::function()
calls have been removed fromadmiral
functions. (#1842) -
restrict_derivation()
had a bug which led to failure if thederivation
argument was not in the global environment. (#1765)
admiral 0.10.2
- Changing package maintainer from Thomas Neitmann to Ben Straub (#1848)
admiral 0.10.1
- Fix checks on derive_vars_dtm() and derive_vars_dt() that were too restrictive. (#1810)
admiral 0.10.0
admiral 0.10.0
New Features
-
Using
{testthat}
3rd edition for unit testing. This is stricter in
that messages must be addressed and deprecated functions throw errors. (#1754) -
New function
consolidate_metadata()
for consolidating multiple meta datasets
into a single one (#1479) -
New function
compute_scale()
for computing the average of a vector and
transforming the result from a source to a target range. (#1692) -
New ADPC template script available
ad_adpc.R
which creates PK Concentration
Analysis Dataset (#849). This script includes formatting suitable for
Non-Compartmental Analysis (ADNCA) (#851) -
New function
derive_expected_records()
for adding expected records (#1729) -
New function
derive_extreme_event()
for adding the worst or best observation
for each by group as new records (#1755)
Updates of Existing Functions
-
Arguments
analysis_var
,keep_vars
were added toderive_locf_records()
,
analysis_var
allows to specify analysis variable,keep_vars
keeps variables
that need carrying the last observation forward other thananalysis_var
(e.g.,PARAMN
,VISITNUM
) (#1636). -
The function
create_single_dose_dataset()
adds support for
expanding relative nominal time (e.g. NFRLT) used in Pharmacokinetic
(PK) analyses. The new parameternominal_time
defaults asNULL
and does not change the normal operation of the function. If a
nominal_time
is specified such as NFRLT (Nominal Relative Time
from First Dose) then the nominal time is incremented by the
interval specified inEXDOSFRQ
for example for "QD" records the
NFRLT is incremented by 24 hours, e.g. 0, 24, 48...(#1640). -
create_single_dose_dataset()
is also updated for values of
EXDOSFRQ
with units in days but expected values less than 24
hours, such as "BID", "TID", and "QID". Previously these values of
EXDOSFRQ
may result in duplicate records where the day values are
incremented but the time values are not (#1643) -
The function
derive_var_confirmation_flag()
andfilter_confirmation()
gained thetmp_obs_nr_var
argument. It helps flagging or selecting consecutive
observations or the first or last observation in a by group. (#1724) -
The functions
derive_vars_merged()
,derive_var_merged_cat()
,
derive_var_merged_character()
,derive_var_merged_exist_flag()
,
derive_var_merged_summary()
, andderive_vars_merged_lookup()
were updated to
allow renaming in the argumentby_vars
(#1680). -
The units "min" and "sec" are added as valid values of
out_unit
incompute_duration()
andderive_vars_duration()
(#1647). -
The function
derive_vars_query()
now includes a consistency check for
QUERY_SCOPE
andQUERY_SCOPE_NUM
values. (#652) -
Argument
new_var
inderive_param_extreme_event()
is made optional. (#1630) -
derive_vars_last_dose()
no longer fails ifUSUBJID
is not included in the
input dataset. (#1787)
Breaking Changes
-
All function arguments which expected a list of quosures created by
vars()
are now expecting a list of expressions created byexprs()
. For example,
instead ofby_vars = vars(STUDYID, USUBJID)
by_vars = exprs(STUDYID, USUBJID)
must be used now.To enable running old scripts using
vars()
in the admiral function calls
admiral redefines thevars()
function such that it returns a list of
expressions. This can be disabled by the admiral optionforce_admiral_vars
(seeset_admiral_options()
). Please note that this is a temporary solution
and will be removed in a future admiral release. (#1627) -
Function
derive_param_tte()
has been updated such that only observations are
added for subjects who have both an event or censoring and an observation in
dataset_adsl
(#1576). -
Function
derive_var_disposition_status()
has been deprecated, please usederive_var_merged_cat()
instead (#1681). -
Function
derive_var_worst_flag()
has been deprecated, in favor ofslice_derivation()
/derive_var_extreme_flag()
(#1682) -
Function
derive_vars_disposition_reason()
has been deprecated, in favor ofderive_vars_merged()
(#1683) -
The following functions have been deprecated from previous
{admiral}
versions using the next phase of the deprecation process: (#1712)derive_derived_param()
derive_param_first_event()
derive_vars_merged_dt()
derive_vars_merged_dtm()
derive_var_agegr_ema()
derive_var_agegr_fda()
-
The following functions, which were deprecated in previous
{admiral}
versions, have been removed (#1712):derive_var_ady()
derive_var_aendy()
derive_var_astdy()
derive_var_atirel()
derive_vars_suppqual()
smq_select()
sdg_select()
-
The following parameters, which were deprecated in previous
{admiral}
versions, have been removed (#1712):meddra_version
,whodd_version
,get_smq_fun
andget_sdg_fun
from thecreate_query_data()
functiondate_imputation
,time_imputation
andpreserve
parameters fromdate_source()
functionfilter
parameter fromderive_var_extreme_flag()
-
ADLB
metadata data set calledatoxgr_criteria_ctcv5
updated to remove unit check for
HYPERURICEMIA
as grade criteria based onANRHI
only. This metadata holds criteria for lab grading
based on Common Terminology Criteria for Adverse Events (CTCAE) v5.0 (#1650) -
Renamed
derive_var_confirmation_flag()
andfilter_confirmation()
to
derive_var_joined_exist_flag()
andfilter_joined()
respectively (#1738).
Documentation
-
New vignette "Creating a PK NCA ADaM (ADPC/ADNCA)" (#1639)
-
New vignette "Hy's Law Implementation" (#1637)
-
New vignette "Creating Questionnaire ADaMs" (#1715)
-
The expected value for the
derivation
argument ofrestrict_derivation()
,
slice_derivation()
, andcall_derivation()
is described now. (#1698) -
Removed authors from function documentation, as we will now only be tracking an overall list of
authors for admiral. (#1673) -
Added an imputation example for
create_single_source_dataset()
in function documentation (#1408)(#1760) -
Updates to examples for
derive_var_age_years()
andderive_vars_duration()
(#1620)(#1634) -
Increased the level of documentation for
derive_var_age_years()
to describe the data type of the newly creatednew_var
column. (#970)
Various
- Functions
derive_vars_dtm()
andderive_vars_dt()
had a bug pertaining to imputations associated withNA
values that has now been fixed (#1646)
admiral 0.9.1
admiral 0.9.1
- Implement changes to if_else() from the release of dplyr version 1.1.0, which affects derive_vars_dtm() and and compute_tmf(). (#1641)
admiral 0.9.0
admiral 0.9.0
New Features
-
The new function
derive_vars_joined()
adds variables from an additional
dataset. The selection of the observations can depend on variables from both
datasets. This can be used for addingAVISIT
,AWLO
,AWHI
based on time
windows andADY
or deriving the lowest value (nadir) before the current
observation (#1448). -
New function
derive_var_trtemfl()
for deriving treatment emergent flags (#989) -
The new function
chr2vars()
turns a character vector into a list of quosures
(#1448). -
New function
derive_var_relative_flag()
for flagging observations before or
after a condition is fulfilled (#1453) -
New functions
get_admiral_option()
andset_admiral_options()
to allow more
flexibility on common function inputs; e.g. likesubject_keys
to avoid several
find and replace instances ofvars(STUDYID, USUBJID)
. (#1338) -
The new function
create_period_dataset()
for creating a reference dataset
for subperiods, periods, or phases from the ADSL dataset was added. The
reference dataset can be used to create subperiod, period, and phase variables
in OCCDS and BDS datasets. (#1477) -
The new function
derive_vars_period()
adds subperiod, period, or phase
variables to ADSL. The values for the new variables are provided by a period
reference dataset. (#1477) -
New function
derive_var_merged_summary()
adds a variable of summarized
values to the input dataset (#1564) -
A
print()
method was added for all S3 objects defined by admiral, e.g.,
date_source()
,dthcaus_source()
, ... (#858) -
New metadata data set called
atoxgr_criteria_ctcv5
which holds criteria for lab grading
based on Common Terminology Criteria for Adverse Events (CTCAE) v5.0 -
Removed the
{assertthat}
dependency in{admiral}
(#1392) -
Removed R Version 3.6 check in CI/CD workflows in favor of the three most recent versions: 4.0, 4.1 and 4.2. (#1556)
-
The new function
derive_locf_records()
adds LOCF records as new observations.
This can be used when the input dataset does not contain observations for missed
visits/time points or whenAVAL
isNA
for particular visits/time points (#1316). -
New function
convert_na_to_blanks()
to convert characterNA
to blanks (#1624)
Updates of Existing Functions
-
Function
derive_param_first_event()
has been replaced by a more generalizedderive_param_extreme_event()
function with new argumentmode
allowing for the selection of either the"first"
or"last"
event record according to the conditions provided. Also thedate_var
argument has been replaced with theorder
argument instead. In addition, three new argumentsnew_var
,true_value
, andfalse_value
have been added to allow the user to choose what variable is used to indicate whether an event happened, and the values it is given (#1317) (#1242). -
Argument
ignore_time_for_ref_end_date
was added toderive_var_ontrtfl()
,
which controls if time is considered for the condition ifstart_date
is after
ref_end_date
+ref_end_window
days (#989). -
derive_var_atoxgr_dir()
default value ofatoxgr_criteria_ctcv4
removed for
parametermeta_criteria
. Can now also chooseatoxgr_criteria_ctcv5
for parameter
meta_criteria
, to implement NCI-CTCAEv5 grading criteria . -
Environment objects were consolidated into a single
admiral_environment
object underR/admiral__environment.R
. (#1572) -
The default value of the
keep_source_vars
argument in
create_single_dose_dataset()
was updated such that it takes the values of the
other arguments into account and thestart_datetime
andend_datetime
arguments are optional now (#1598). -
Function
create_query_data()
has been updated such that the dictionary
version is stored in the output dataset (#1337).
Breaking Changes
-
Function
derive_param_first_event()
has been deprecated. Please usederive_param_extreme_event()
with theorder
argument instead of thedate_var
argument (#1317). -
Functions
smq_select()
andsdg_select()
have been deprecated and replaced withbasket_select()
. In thecreate_query_data()
function,meddra_version
andwhodd_version
argument has been replaced byversion
andget_smq_fun
andget_sdg_fun
argument byget_terms_fun
. (#1597)
Documentation
Various
-
Function
derive_param_tte()
had a bug that setADT
toNA
whenstart_date
was missing, which has now been fixed (#1540) -
Function
derive_vars_merged()
had an improperly formatted error message
which has been corrected (#1473) -
Templates now save datasets as
.rds
instead of.rda
(#1501) -
Function
create_single_dose_dataset()
no longer fails if the input dataset
contains observations with dose frequency"ONCE"
(#1375).
admiral 0.8.4
Fixed a bug where a recent update to {lifecylce} caused several admiral tests to break (#1500)
admiral 0.8.3
v0.8.3 Release v0.8.3
admiral 0.8.1
derive_var_extreme_dt()
andderive_var_extreme_dtm()
were updated such
that source observations where the date isNA
are excluded (#1419)
admiral 0.8.0
New Features
-
get_summary_records()
creates summary records e.g. derive analysis value (AVAL
) from multiple records, only keeping the derived observations (#525) -
derive_param_framingham()
adds a Parameter for Framingham Heart Study Cardiovascular Disease 10-Year Risk Score (#977) -
compute_qual_imputation()
imputes values when qualifier exists in character result (#976) -
derive_vars_merged_lookup()
maps lookup tables (#940) -
filter_confirmation()
filters out confirmed observations
(#1292) including supporting functionscount_vals()
,min_cond()
, and
max_cond()
. -
derive_var_confirmation_flag()
derives a flag which
depends on other observations of the input dataset (#1293) -
derive_var_atoxgr()
derives lab toxicity/severity gradeATOXGR
fromATOXGRL
andATOXGRH
.ATOXGRL
holds toxicity/severity grade for low lab values,
andATOXGRH
holds toxicity/severity grade for high lab values. -
derive_var_atoxgr_dir()
derives lab toxicity/severity grade for low
lab values (ATOXGRL
) or for high lab values (ATOXGRH
). The grading is created from
metadata. -
New metadata data set called
atoxgr_criteria_ctcv4
which holds criteria for lab grading
based on Common Terminology Criteria for Adverse Events (CTCAE) v4.0
Updates of Existing Functions
-
list_tte_source_objects()
gains apackage
parameter and is now exported (#1212) -
list_all_templates()
anduse_ad_template()
gain apackage
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()
toderive_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 toderive_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 thetime_imputation
argumentNULL
is no
longer a permitted value.) -
It is now possible to impute completely missing dates by specifying
highest_imputation = "Y"
and themin_dates
ormax_dates
argument.
-
-
order
parameter added todthcaus_source()
which allows an additional
character vector to be used for sorting thedataset
,derive_vars_dthcaus()
updated to process additional parameter (#1125). -
create_single_dose_dataset()
Fixed bug whereASTDTM
andAENDTM
were not updated whenstart_date = ASTDT
andend_date = AENDT
. The function has been amended to now requirestart_datetime
andend_datetime
parameters in addition tostart_date
andend_date
.Thekeep_source_vars
has been added to specify the variables to be retained from the source dataset (#1224)
Breaking Changes
-
Moved all developer-facing functions and vignettes to
{admiraldev}
.{admiraldev}
is now a dependency of{admiral}
(#1231) -
All ADaM datasets but
admiral_adsl
have been removed from the package (#1234) -
derive_var_agegr_ema()
andderive_var_agegr_fda()
have been deprecated (#1333) -
Imputation related arguments have been deprecated for all functions except the
imputation functions themselves (#1299). I.e., if a derivation like last known alive
date is based on dates, DTC variables have to be converted to numeric date or
datetime variables in a preprocessing step. For examples see the ADSL
vignette.The following arguments were deprecated:
date_imputation
,time_imputation
, andpreserve
indate_source()
The following arguments no longer accept DTC variables:
date
indate_source()
,dthcaus_source()
,censor_source()
, and
event_source()
dose_date
andanalysis_date
inderive_vars_last_dose()
,
derive_var_last_dose_amt()
,derive_var_last_dose_date()
,
derive_var_last_dose_grp()
The following functions were deprecated:
derive_vars_merged_dt()
derive_vars_merged_dtm()
-
For the
date_imputation
and thetime_imputation
argument of the imputation
functions (derive_vars_dtm()
,derive_vars_dt()
,convert_dtc_to_dtm()
,
convert_dtc_to_dt()
)NULL
is no longer a permitted value. The level of
imputation can be controlled by thehighest_imputation
argument now. -
The following functions, which were deprecated in previous {admiral} versions,
have been removed:derive_var_disposition_dt()
derive_var_lstalvdt()
lstalvdt_source()
derive_var_trtedtm()
derive_var_trtsdtm()
-
The following functions and parameters, which were deprecated in previous
{admiral} versions, are now defunct and will output an ERROR if used:derive_var_ady()
derive_var_aendy()
derive_var_astdy()
derive_var_atirel()
filter
parameter inderive_var_extreme_flag()
andderive_var_worst_flag()
Documentation
-
New ADMH template script can be accessed using
admiral::use_ad_template("admh")
(#502) -
New vignette "Higher Order Functions" (#1047)
-
New vignette "Lab Grading" (#1369)
-
Fixed
derive_var_disposition_status()
argument to render correctly (#1268) -
Added link to pharmaverse YouTube channel to README