From 20de30d7aa5fa2de6ecfebfc2687104058e90ac4 Mon Sep 17 00:00:00 2001 From: steventing12 Date: Thu, 14 Nov 2024 19:33:49 +0800 Subject: [PATCH] Closes #254 Replace exprs(STUDYID, USUBJID) with get_admiral_option("subject_keys") in by_vars input of derive_vars_merged() (#255) * feat: #254 Replace exprs(STUDYID, USUBJID) with get_admiral_option("subject_keys") in by_vars input of derive_vars_merged() * #254 add get_admiral_option to list of imports * #254 fix failing lint --------- Co-authored-by: Edoardo Mancini <53403957+manciniedoardo@users.noreply.github.com> Co-authored-by: Edoardo Mancini --- NAMESPACE | 1 + R/admiralophtha-package.R | 1 + R/derive_var_studyeye.R | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index a4f2cd8e..d0104a36 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,6 +7,7 @@ export(derive_var_bcvacritxfl) export(derive_var_studyeye) importFrom(admiral,derive_param_computed) importFrom(admiral,derive_vars_merged) +importFrom(admiral,get_admiral_option) importFrom(admiral,params) importFrom(admiral,restrict_derivation) importFrom(admiraldev,assert_character_scalar) diff --git a/R/admiralophtha-package.R b/R/admiralophtha-package.R index 07ffe6b4..dce6e83e 100644 --- a/R/admiralophtha-package.R +++ b/R/admiralophtha-package.R @@ -24,6 +24,7 @@ #' @importFrom hms as_hms #' @importFrom lifecycle deprecate_warn deprecated deprecate_stop #' @importFrom admiral derive_vars_merged restrict_derivation params derive_param_computed +#' get_admiral_option #' @importFrom admiraldev assert_symbol assert_data_frame expect_dfs_equal assert_data_frame #' assert_character_vector assert_character_scalar assert_integer_scalar #' assert_numeric_vector assert_vars expr_c vars2chr diff --git a/R/derive_var_studyeye.R b/R/derive_var_studyeye.R index dee9e903..f20315e2 100644 --- a/R/derive_var_studyeye.R +++ b/R/derive_var_studyeye.R @@ -57,7 +57,7 @@ derive_var_studyeye <- function(dataset_adsl, dataset_sc, sctestcd_value = "FOCI derive_vars_merged( dataset_adsl, dataset_add = dataset_sc, - by_vars = exprs(STUDYID, USUBJID), + by_vars = get_admiral_option("subject_keys"), order = NULL, filter_add = SCTESTCD == !!sctestcd_value, new_vars = exprs(STUDYEYE = SCSTRESC),