From c6a5b969699dc0dbf9969b20a328c2238d6af2ef Mon Sep 17 00:00:00 2001 From: "Matthias,Korbinian (MED BDS) BIP-DE-B" Date: Mon, 19 Aug 2024 09:59:26 +0100 Subject: [PATCH] Add na.rm to max call in prepare_initial_data() --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/helper_functions.R | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 244cc78..0c529cc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: dv.edish Type: Package Title: eDISH Plot Module for DILI assessment -Version: 1.0.3 +Version: 1.0.4 Authors@R: c( person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")), diff --git a/NEWS.md b/NEWS.md index 683fa7e..1a1a320 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# dv.edish 1.0.4 + +- The module ignores now NA values when calculating the maximum value. + # dv.edish 1.0.3 - Initial release of dv.edish package to GitHub. diff --git a/R/helper_functions.R b/R/helper_functions.R index 1ddf9f9..b620250 100644 --- a/R/helper_functions.R +++ b/R/helper_functions.R @@ -71,7 +71,7 @@ prepare_initial_data <- function( dataset <- Reduce(dplyr::full_join, sel_dataset_list) %>% dplyr::filter(.data[[lb_test_var]] %in% lb_test_choices) %>% dplyr::group_by(.data[[subjectid_var]], .data[[arm_var]], .data[[lb_test_var]], .data[[visit_var]]) %>% - dplyr::filter(.data[[lb_result_var]] == max(.data[[lb_result_var]])) %>% + dplyr::filter(.data[[lb_result_var]] == max(.data[[lb_result_var]], na.rm = TRUE)) %>% dplyr::distinct() %>% dplyr::ungroup()