Skip to content

Commit

Permalink
Merge branch 'main' into 2142_derive_summary_records_get_summary_reco…
Browse files Browse the repository at this point in the history
…rds_mods
  • Loading branch information
zdz2101 authored Oct 6, 2023
2 parents 1b7e9ab + ef44637 commit c06bc8c
Show file tree
Hide file tree
Showing 118 changed files with 273 additions and 274 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

## Documentation

- A way to standardize roxygen labels and descriptions for function arguments was implemented and tested (#2034)

## Various

# admiral 0.12.2
Expand Down
2 changes: 1 addition & 1 deletion R/call_derivation.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Call a single derivation multiple times with some parameters/arguments being fixed across
#' iterations and others varying.
#'
#' @param dataset The input dataset
#' @param dataset `r roxygen_param_dataset()`
#' @param derivation The derivation function to call
#'
#' A function that performs a specific derivation is expected. A derivation
Expand Down
6 changes: 2 additions & 4 deletions R/create_single_dose_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,8 @@ dose_freq_lookup <- tribble(
#' necessary when e.g. calculating last dose before an adverse event in `ADAE`
#' or deriving a total dose parameter in `ADEX` when `EXDOSFRQ != ONCE`.
#'
#' @param dataset Input dataset
#'
#' The columns specified by `dose_freq`, `start_date` and the `end_date`
#' parameters are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("dose_freq", "start_date", "end_date"))`
#'
#' @param dose_freq The dose frequency
#'
Expand Down
14 changes: 6 additions & 8 deletions R/derive_adeg_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` and the `unit_var` parameter,
#' `PARAMCD`, and `AVAL` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars", "get_unit_expr"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down Expand Up @@ -257,10 +256,9 @@ compute_qtc <- function(qt, rr, method) {
#' The analysis value of the new parameter is derived as
#' \deqn{\frac{60000}{HR}}{60000 / HR}
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter, `PARAMCD`, and `AVAL`
#' are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down
21 changes: 9 additions & 12 deletions R/derive_advs_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter, `PARAMCD`, and
#' `AVAL` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down Expand Up @@ -226,10 +225,9 @@ compute_map <- function(diabp, sysbp, hr = NULL) {
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter, `PARAMCD`, and
#' `AVAL` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down Expand Up @@ -549,10 +547,9 @@ compute_bsa <- function(height = height,
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter, `PARAMCD`, and
#' `AVAL` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down
5 changes: 2 additions & 3 deletions R/derive_basetype_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
#' Adds the `BASETYPE` variable to a dataset and duplicates records based upon
#' the provided conditions.
#'
#' @param dataset Input dataset
#'
#' The columns specified in the expressions inside `basetypes` are required.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("basetypes"))`
#'
#' @param basetypes A *named* list of expressions created using the
#' `rlang::exprs()` function
Expand Down
10 changes: 4 additions & 6 deletions R/derive_date_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -1252,9 +1252,8 @@ compute_tmf <- function(dtc,
#' impute, we only enable to impute up to a highest level, i.e. you couldn't
#' choose to say impute months, but not days.
#'
#' @param dataset Input dataset.
#'
#' The date character vector (`dtc`) must be present.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("dtc"))`
#'
#' @param new_vars_prefix Prefix used for the output variable(s).
#'
Expand Down Expand Up @@ -1461,9 +1460,8 @@ derive_vars_dt <- function(dataset, # nolint: cyclocomp_linter
#' impute, we only enable to impute up to a highest level, i.e. you couldn't
#' choose to say impute months, but not days.
#'
#' @param dataset Input dataset
#'
#' The date character vector (`dtc`) must be present.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("dtc"))`
#'
#' @param new_vars_prefix Prefix used for the output variable(s).
#'
Expand Down
6 changes: 2 additions & 4 deletions R/derive_expected_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
#' Add expected records as new observations for each 'by group' when the dataset
#' contains missing observations.
#'
#' @param dataset Input dataset
#'
#' A data frame, the columns from `dataset_ref` and specified by the
#' `by_vars` parameter are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("dataset_ref", "by_vars"))`
#'
#' @param dataset_expected_obs *Deprecated*, please use `dataset_ref` instead.
#'
Expand Down
10 changes: 9 additions & 1 deletion R/derive_extreme_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' distinguishes `derive_extreme_records()` from `derive_summary_records()`,
#' where only the by variables are populated for the new records.
#'
#' @param dataset Input dataset
#' @param dataset `r roxygen_param_dataset()`
#'
#' If `dataset_add` is not specified, the new records are selected from the
#' input dataset. In this case the variables specified by `by_vars` and
Expand Down Expand Up @@ -92,6 +92,14 @@
#' automatically.
#'
#'
#' @param keep_source_vars Variables to be kept in the new records
#'
#' A named list or tidyselect expressions created by `exprs()` defining the
#' variables to be kept for the new records. The variables specified for
#' `by_vars` and `set_values_to` need not be specified here as they are kept
#' automatically.
#'
#'
#' @inheritParams filter_extreme
#' @inheritParams derive_summary_records
#'
Expand Down
5 changes: 2 additions & 3 deletions R/derive_joined.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
#' variables from both datasets. For example, add the lowest value (nadir)
#' before the current observation.
#'
#' @param dataset Input dataset
#'
#' The variables specified by `by_vars` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#'
#' @param dataset_add Additional dataset
#'
Expand Down
6 changes: 2 additions & 4 deletions R/derive_locf_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
#' Adds LOCF records as new observations for each 'by group' when the dataset
#' does not contain observations for missed visits/time points.
#'
#' @param dataset Input dataset
#'
#' The columns specified by the `by_vars`, `analysis_var`, `order`,
#' `keep_vars` parameters are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars", "analysis_var", "order", "keep_vars"))`
#'
#' @param dataset_expected_obs *Deprecated*, please use `dataset_ref` instead.
#'
Expand Down
10 changes: 4 additions & 6 deletions R/derive_merged.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
#' (`filter_add` argument) and/or selecting the first or last observation for
#' each by group (`order` and `mode` argument).
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` argument are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#'
#' @param dataset_add Additional dataset
#'
Expand Down Expand Up @@ -710,9 +709,8 @@ get_not_mapped <- function() {
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_merged`.
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` argument are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#'
#' @param dataset_add Additional dataset
#'
Expand Down
9 changes: 5 additions & 4 deletions R/derive_param_computed.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#' blood pressure (DIABP) with the formula
#' \deqn{MAP = \frac{SYSBP + 2 DIABP}{3}}{MAP = (SYSBP + 2 DIABP) / 3}
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD` is expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down Expand Up @@ -428,7 +428,8 @@ assert_parameters_argument <- function(parameters, optional = TRUE) {
#' The function creates temporary parameters and variables of the form
#' `<variable>.<parameter>`, e.g., `AVAL.WEIGHT`.
#'
#' @param dataset Input dataset
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#'
#' @param by_vars By variables
#'
Expand Down
7 changes: 3 additions & 4 deletions R/derive_param_doseint.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#' The analysis value of the new parameter is derived as
#' Total Dose / Planned Dose * 100
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter, `PARAMCD`, and
#' `AVAL` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down
7 changes: 3 additions & 4 deletions R/derive_param_exist_flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#' function can derive a parameter indicating if there is measurable disease at
#' baseline.
#'
#' @param dataset Input dataset
#'
#' The variables specified for `by_vars` and the `PARAMCD` variable are
#' expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD` is expected as well.
#'
#' @param dataset_ref Reference dataset, e.g., ADSL
#'
Expand Down
7 changes: 3 additions & 4 deletions R/derive_param_exposure.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
#' Add a record computed from the aggregated analysis value of another parameter and compute the
#' start (`ASTDT(M)`)and end date (`AENDT(M)`) as the minimum and maximum date by `by_vars`.
#'
#' @param dataset Input dataset
#'
#' + The variables specified by the `by_vars`,`analysis_var` parameters and `PARAMCD` are
#' expected,
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars", "analysis_var"))`
#' `PARAMCD` is expected as well,
#' + Either `ASTDTM` and `AENDTM` or `ASTDT` and `AENDT` are also expected.
#'
#' @param filter Filter condition
Expand Down
2 changes: 1 addition & 1 deletion R/derive_param_extreme_record.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' source datasets, based on user-defined filter, order and by group criteria.
#' All variables of the selected observation are kept.
#'
#' @param dataset Input dataset
#' @param dataset `r roxygen_param_dataset()`
#'
#' @param sources Sources
#'
Expand Down
7 changes: 3 additions & 4 deletions R/derive_param_framingham.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
#' Adds a record for framingham score (FCVD101) for each by group
#' (e.g., subject and visit) where the source parameters are available.
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` parameter, `PARAMCD`, and
#' `AVAL` are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset after restricting it by the filter condition (`filter`
Expand Down
5 changes: 2 additions & 3 deletions R/derive_param_tte.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#'
#' Add a time-to-event parameter to the input dataset.
#'
#' @param dataset Input dataset
#'
#' The `PARAMCD` variable is expected.
#' @param dataset `r roxygen_param_dataset()`
#' `PARAMCD` is expected.
#'
#' @param dataset_adsl ADSL input dataset
#'
Expand Down
7 changes: 3 additions & 4 deletions R/derive_param_wbc_abs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
#'
#' Add a parameter by converting lab differentials from fraction or percentage to absolute values
#'
#' @param dataset Input dataset
#'
#' The variables specified by the `by_vars` argument, `PARAMCD`, and `AVAL`
#' are expected to be present.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("by_vars"))`
#' `PARAMCD`, and `AVAL` are expected as well.
#'
#' The variable specified by `by_vars` and `PARAMCD` must be a unique key of
#' the input dataset, and to the parameters specified by `wbc_code` and `diff_code`.
Expand Down
2 changes: 1 addition & 1 deletion R/derive_summary_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' retain those common values in the newly derived records. Otherwise new value
#' will be set to `NA`.
#'
#' @param dataset A data frame.
#' @param dataset `r roxygen_param_dataset(expected_vars = c("by_vars", "analysis_var"))`
#'
#' @param by_vars Variables to consider for generation of groupwise summary
#' records. Providing the names of variables in [exprs()] will create a
Expand Down
3 changes: 2 additions & 1 deletion R/derive_var_analysis_ratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#'
#' Derives a ratio variable for a BDS dataset based on user specified variables.
#'
#' @param dataset Input dataset
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("numer_var", "denom_var"))`
#'
#' @param numer_var Variable containing numeric values to be used in the numerator of
#' the ratio calculation.
Expand Down
6 changes: 5 additions & 1 deletion R/derive_var_anrind.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' Derive Reference Range Indicator
#'
#' @param dataset The input dataset
#' @param dataset
#' `r roxygen_param_dataset()`
#' `ANRLO`, `ANRHI`, and `AVAL` are expected and if `use_a1hia1lo` is set to `TRUE`,
#' `A1LO` and `A1H1` are expected as well.
#'
#' @param use_a1hia1lo A logical value indicating whether to use `A1H1` and `A1LO` in
#' the derivation of `ANRIND`.
#'
Expand Down
12 changes: 5 additions & 7 deletions R/derive_var_atoxgr.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#' @description
#' Derives a character lab grade based on severity/toxicity criteria.
#'
#' @param dataset Input data set
#'
#' The columns specified by `tox_description_var` parameter is expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("tox_description_var"))`
#'
#' @param new_var Name of the character grade variable to create, for example, `ATOXGRH`
#' or `ATOXGRL`.
Expand Down Expand Up @@ -246,10 +245,9 @@ derive_var_atoxgr_dir <- function(dataset,
#'
#' Derives character lab grade based on high and low severity/toxicity grade(s).
#'
#' @param dataset Input data set
#'
#' The columns `ATOXGRL`, `ATOXGRH` and specified by `lotox_description_var`,
#' and `hitox_description_var` parameters are expected.
#' @param dataset
#' `r roxygen_param_dataset(expected_vars = c("lotox_description_var", "hitox_description_var"))`
#' `ATOXGRL`, and `ATOXGRH` are expected as well.
#'
#' @param lotox_description_var Variable containing the toxicity grade description
#' for low values, eg. "Anemia"
Expand Down
Loading

0 comments on commit c06bc8c

Please sign in to comment.