Skip to content

Commit

Permalink
fix: #1797 address merge conflicts
Browse files Browse the repository at this point in the history
Merge branch 'devel' into 1797_deprecate_derive_var_last_dose@devel

# Conflicts:
#	man/derive_var_last_dose_amt.Rd
#	man/derive_var_last_dose_date.Rd
#	man/derive_var_last_dose_grp.Rd
  • Loading branch information
Zelos Zhu committed May 30, 2023
2 parents c5d7ea1 + 0efa6a3 commit 7a61bd3
Show file tree
Hide file tree
Showing 65 changed files with 2,371 additions and 2,301 deletions.
13 changes: 13 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Set renv profile base on R version.
renv_profile <- paste(R.version$major, substr(R.version$minor, 1,1), sep = ".")
if (file.exists("./renv/profile")){
message("Using renv profile from `renv/profile` file.")
} else if (renv_profile %in% c("4.1", "4.2", "4.3")) {
message("Set renv profile to `", renv_profile, "`")
Sys.setenv("RENV_PROFILE" = renv_profile)
} else {
message("This repository do not contains the renv profile for your R version.")
}

if (Sys.getenv("GITHUB_ACTIONS") == "") {
source("renv/activate.R")
} else {
options(repos = c(CRAN = "https://cran.rstudio.com"))
}


16 changes: 8 additions & 8 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/style.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
spellcheck:
name: Spelling
uses: pharmaverse/admiralci/.github/workflows/spellcheck.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
readme:
name: Render README
uses: pharmaverse/admiralci/.github/workflows/readme-render.yml@main
if: github.event_name == 'push'
with:
r-version: "4.0"
r-version: "4.1"
validation:
name: Validation
uses: pharmaverse/admiralci/.github/workflows/r-pkg-validation.yml@main
if: github.event_name == 'release'
with:
r-version: "4.0"
r-version: "4.1"
check:
name: Check
uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main
Expand All @@ -71,7 +71,7 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main
if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
with:
r-version: "4.0"
r-version: "4.1"
# Whether to skip multiversion docs
# Note that if you have multiple versions of docs,
# your URL links are likely to break due to path changes
Expand All @@ -85,7 +85,7 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
links:
name: Links
uses: pharmaverse/admiralci/.github/workflows/links.yml@main
Expand All @@ -96,7 +96,7 @@ jobs:
if: >
github.event_name != 'release'
with:
r-version: "4.0"
r-version: "4.1"
# Whether to skip code coverage badge creation
# Setting to 'false' will require you to create
# an orphan branch called 'badges' in your repository
Expand All @@ -106,4 +106,4 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/man-pages.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
2 changes: 1 addition & 1 deletion .github/workflows/templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main
if: github.event.review.state == 'approved'
with:
r-version: "4.0"
r-version: "4.1"
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ export(extend_source_datasets)
export(extract_duplicate_records)
export(extract_unit)
export(filter_date_sources)
export(filter_exist)
export(filter_extreme)
export(filter_joined)
export(filter_not_exist)
export(filter_relative)
export(format_eoxxstt_default)
export(format_reason_default)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

- New function `compute_age_years()` for converting a vector of age values to years. (#1794)

- New functions `filter_exist()` and `filter_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 (#1772) based on forthcoming CDISC Implementation guide.

- New function `compute_egfr()` for calculating Estimated Glomerular Filtration Rate (eGFR) and Creatinine Clearance for Kidney Function (#1826)

## Updates of Existing Functions
Expand Down Expand Up @@ -83,9 +89,13 @@ the `filter_add` argument. (#1725)

- 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).

- Increased documentation for those functions which are regarded as wrapper functions (#1726)

## Various

- `vars()` which was used in the admiral function calls that expected a list of
Expand Down
8 changes: 6 additions & 2 deletions R/derive_adeg_params.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#' Adds a Parameter for Corrected QT (an ECG measurement)
#'
#' Adds a record for corrected QT using either Bazett's, Fridericia's or Sagie's
#' @description Adds a record for corrected QT using either Bazett's, Fridericia's or Sagie's
#' formula for each by group (e.g., subject and visit) where the source parameters
#' are available.
#'
#' **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,
Expand Down Expand Up @@ -238,9 +240,11 @@ compute_qtc <- function(qt, rr, method) {

#' Adds a Parameter for Derived RR (an ECG measurement)
#'
#' Adds a record for derived RR based on heart rate for each by group (e.g.,
#' @description Adds a record for derived RR based on heart rate for each by group (e.g.,
#' subject and visit) where the source parameters are available.
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' The analysis value of the new parameter is derived as
#' \deqn{\frac{60000}{HR}}{60000 / HR}
#'
Expand Down
15 changes: 11 additions & 4 deletions R/derive_advs_params.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#' Adds a Parameter for Mean Arterial Pressure
#'
#' Adds a record for mean arterial pressure (MAP) for each by group
#' @description Adds a record for mean arterial pressure (MAP) for each by group
#' (e.g., subject and visit) where the source parameters are available.
#'
#' **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
Expand Down Expand Up @@ -204,8 +206,11 @@ compute_map <- function(diabp, sysbp, hr = NULL) {

#' Adds a Parameter for BSA (Body Surface Area) Using the Specified Method
#'
#' Adds a record for BSA (Body Surface Area) using the specified derivation method
#' for each by group (e.g., subject and visit) where the source parameters are available.
#' @description Adds a record for BSA (Body Surface Area) using the specified derivation
#' method for each by group (e.g., subject and visit) where the source parameters are
#' available.
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' @param dataset Input dataset
#'
Expand Down Expand Up @@ -453,9 +458,11 @@ compute_bsa <- function(height = height,

#' Adds a Parameter for BMI
#'
#' Adds a record for BMI/Body Mass Index using Weight and Height each by group
#' @description Adds a record for BMI/Body Mass Index using Weight and Height each by group
#' (e.g., subject and visit) where the source parameters are available.
#'
#' **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
Expand Down
5 changes: 4 additions & 1 deletion R/derive_date_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,10 @@ convert_dtc_to_dtm <- function(dtc,

#' Convert a Date into a Datetime Object
#'
#' Convert a date (datetime, date, or date character) into a Date vector (usually `'--DTM'`).
#' @description Convert a date (datetime, date, or date character) into a Date
#' vector (usually `'--DTM'`).
#'
#' **Note:** This is a wrapper function for the function `convert_dtc_to_dtm()`.
#'
#' @param dt The date to convert.
#'
Expand Down
11 changes: 8 additions & 3 deletions R/derive_merged.R
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,11 @@ derive_var_merged_cat <- function(dataset,

#' Merge an Existence Flag
#'
#' Adds a flag variable to the input dataset which indicates if there exists at
#' least one observation in another dataset fulfilling a certain condition.
#' @description Adds a flag variable to the input dataset which indicates if
#' there exists at least one observation in another dataset fulfilling a certain
#' condition.
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_merged()`.
#'
#' @param dataset_add Additional dataset
#'
Expand Down Expand Up @@ -811,7 +814,9 @@ get_not_mapped <- function() {

#' Merge a Summary Variable
#'
#' Merge a summary variable from a dataset to the input dataset.
#' @description Merge a summary variable from a dataset to the input dataset.
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_merged`.
#'
#' @param dataset Input dataset
#'
Expand Down
4 changes: 3 additions & 1 deletion R/derive_param_doseint.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#' Adds a Parameter for Dose Intensity
#'
#' Adds a record for the dose intensity for each by group
#' @description Adds a record for the dose intensity for each by group
#' (e.g., subject and visit) where the source parameters are available.
#'
#' **Note:** This is a wrapper function for the more generic `derive_param_computed()`.
#'
#' The analysis value of the new parameter is derived as
#' Total Dose / Planned Dose * 100
#'
Expand Down
8 changes: 6 additions & 2 deletions R/derive_param_tte.R
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,11 @@ tte_source <- function(dataset_name,

#' Create an `event_source` Object
#'
#' `event_source` objects are used to define events as input for the
#' @description `event_source` objects are used to define events as input for the
#' `derive_param_tte()` function.
#'
#' **Note:** This is a wrapper function for the more generic `tte_source()`.
#'
#' @inheritParams tte_source
#'
#'
Expand Down Expand Up @@ -854,9 +856,11 @@ event_source <- function(dataset_name,

#' Create a `censor_source` Object
#'
#' `censor_source` objects are used to define censorings as input for the
#' @description `censor_source` objects are used to define censorings as input for the
#' `derive_param_tte()` function.
#'
#' **Note:** This is a wrapper function for the more generic `tte_source()`.
#'
#' @inheritParams tte_source
#'
#'
Expand Down
4 changes: 3 additions & 1 deletion R/derive_var_base.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#' Derive Baseline Variables
#'
#' Derive baseline variables, e.g. `BASE` or `BNRIND`, in a BDS dataset
#' @description Derive baseline variables, e.g. `BASE` or `BNRIND`, in a BDS dataset.
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_merged()`.
#'
#' @param dataset The input dataset
#'
Expand Down
6 changes: 4 additions & 2 deletions R/derive_var_extreme_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ derive_var_extreme_dtm <- function(dataset,

#' Derive First or Last Date from Multiple Sources
#'
#' Add the first or last date from multiple sources to the dataset, e.g.,
#' the last known alive date (`LSTALVDT`).
#' @description Add the first or last date from multiple sources to the
#' dataset, e.g., the last known alive date (`LSTALVDT`).
#'
#' **Note:** This is a wrapper function for the function `derive_var_extreme_dtm()`.
#'
#' @inheritParams derive_var_extreme_dtm
#'
Expand Down
4 changes: 3 additions & 1 deletion R/derive_var_last_dose_amt.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#' Derive Last Dose Amount
#'
#' Add a variable for dose amount from the last dose to the input dataset.
#' @description Add a variable for dose amount from the last dose to the input dataset.
#'
#' **Note:** This is a wrapper function for the function `derive_vars_last_dose()`.
#'
#' @description
#' `r lifecycle::badge("deprecated")`
Expand Down
5 changes: 4 additions & 1 deletion R/derive_var_last_dose_date.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' Derive Last Dose Date-Time
#'
#' Add a variable for the dose date or datetime of the last dose to the input dataset.
#' @description Add a variable for the dose date or datetime of the last dose to
#' the input dataset.
#'
#' **Note:** This is a wrapper function for the function `derive_vars_last_dose()`.
#'
#' @description
#' `r lifecycle::badge("deprecated")`
Expand Down
5 changes: 4 additions & 1 deletion R/derive_var_last_dose_grp.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' Derive Last Dose with User-Defined Groupings
#'
#' Add a variable for user-defined dose grouping of the last dose to the input dataset.
#' @description Add a variable for user-defined dose grouping of the last dose
#' to the input dataset.
#'
#' **Note:** This is a wrapper function for the function `derive_vars_last_dose()`.
#'
#' @description
#' `r lifecycle::badge("deprecated")`
Expand Down
4 changes: 3 additions & 1 deletion R/derive_var_trtdurd.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#' Derive Total Treatment Duration (Days)
#'
#' Derives total treatment duration (days) (`TRTDURD`)
#' @description Derives total treatment duration (days) (`TRTDURD`).
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_duration()`.
#'
#' @param dataset Input dataset
#'
Expand Down
4 changes: 3 additions & 1 deletion R/derive_vars_aage.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#' Derive Analysis Age
#'
#' Derives analysis age (`AAGE`) and analysis age unit (`AAGEU`)
#' @description Derives analysis age (`AAGE`) and analysis age unit (`AAGEU`).
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_duration()`.
#'
#' @param dataset Input dataset
#'
Expand Down
4 changes: 3 additions & 1 deletion R/derive_vars_transposed.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ derive_vars_transposed <- function(dataset,

#' Derive ATC Class Variables
#'
#' Add Anatomical Therapeutic Chemical class variables from `FACM` to `ADCM`
#' @description Add Anatomical Therapeutic Chemical class variables from `FACM` to `ADCM`.
#'
#' **Note:** This is a wrapper function for the more generic `derive_vars_transposed()`.
#'
#' @param dataset Input dataset
#'
Expand Down
Loading

0 comments on commit 7a61bd3

Please sign in to comment.