From f5b77de9dadee10537c469221a93ed7bebb6b6a3 Mon Sep 17 00:00:00 2001 From: Edoardo Mancini Date: Thu, 27 Jul 2023 08:31:12 +0000 Subject: [PATCH] #180 removed `derive_var_merged_cat()` in `derive_var_studyeye()` in favour of `derive_vars_merged()` --- NAMESPACE | 3 +-- NEWS.md | 8 ++++++++ R/admiralophtha-package.R | 4 ++-- R/derive_var_studyeye.R | 12 ++++++------ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 8604242e..8735f251 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,7 +6,7 @@ export(derive_var_afeye) export(derive_var_bcvacritxfl) export(derive_var_studyeye) importFrom(admiral,derive_param_computed) -importFrom(admiral,derive_var_merged_cat) +importFrom(admiral,derive_vars_merged) importFrom(admiral,params) importFrom(admiral,restrict_derivation) importFrom(admiraldev,assert_character_scalar) @@ -17,7 +17,6 @@ importFrom(admiraldev,assert_numeric_vector) importFrom(admiraldev,assert_symbol) importFrom(admiraldev,expect_dfs_equal) importFrom(admiraldev,expr_c) -importFrom(admiraldev,quo_c) importFrom(dplyr,arrange) importFrom(dplyr,bind_cols) importFrom(dplyr,bind_rows) diff --git a/NEWS.md b/NEWS.md index fea0d2d2..2e889fa7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# admiralophtha 0.3.0 + +## Updates to Functions + +- Switched out `derive_var_merged_cat()` for `derive_vars_merged()` in the function `derive_var_Studyeye()` due to deprecation of the former in favor of the latter in `{admiral }`(#119). + +## Updates to Templates + # admiralophtha 0.2.0 ## Updates to Functions diff --git a/R/admiralophtha-package.R b/R/admiralophtha-package.R index c7a5b46b..52093ee9 100644 --- a/R/admiralophtha-package.R +++ b/R/admiralophtha-package.R @@ -23,8 +23,8 @@ #' @importFrom tidyselect all_of contains vars_select #' @importFrom hms as_hms #' @importFrom lifecycle deprecate_warn deprecated deprecate_stop -#' @importFrom admiral derive_var_merged_cat restrict_derivation params derive_param_computed -#' @importFrom admiraldev assert_symbol assert_data_frame expect_dfs_equal quo_c assert_data_frame +#' @importFrom admiral derive_vars_merged restrict_derivation params derive_param_computed +#' @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 expr_c "_PACKAGE" diff --git a/R/derive_var_studyeye.R b/R/derive_var_studyeye.R index f70a53da..0ebff98b 100644 --- a/R/derive_var_studyeye.R +++ b/R/derive_var_studyeye.R @@ -54,16 +54,16 @@ derive_var_studyeye <- function(dataset_adsl, dataset_sc, sctestcd_value = "FOCI ) } - derive_var_merged_cat( + derive_vars_merged( dataset_adsl, dataset_add = dataset_sc, by_vars = exprs(STUDYID, USUBJID), order = NULL, filter_add = SCTESTCD == !!sctestcd_value, - new_var = STUDYEYE, - source_var = SCSTRESC, - cat_fun = seye_cat, + new_var = exprs(tmp_STUDYEYE = SCSTRESC), mode = NULL, - missing_value = "" - ) + missing_values = exprs(tmp_STUDYEYE = "") + ) %>% + mutate(STUDYEYE = seye_cat(tmp_STUDYEYE)) %>% + select(-tmp_STUDYEYE) }