From ff913dd2120b53e814a13037eec816e188b30f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:38:18 +0000 Subject: [PATCH] fixes error in adverse events when `ASTDY` is of difftime type (#1284) # Pull Request Fixes #1272 #### Changes description - Similar fix that was applied in #1271 --- R/tm_g_pp_adverse_events.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/tm_g_pp_adverse_events.R b/R/tm_g_pp_adverse_events.R index ccdc10c47..95f1356da 100644 --- a/R/tm_g_pp_adverse_events.R +++ b/R/tm_g_pp_adverse_events.R @@ -52,8 +52,12 @@ template_adverse_events <- function(dataname = "ANL", aeterm, tox_grade, causality, outcome, action, time, decod ) %>% dplyr::arrange(dplyr::desc(tox_grade)) %>% - `colnames<-`(col_labels(dataname, fill = TRUE)[vars]) - + `colnames<-`(col_labels(dataname, fill = TRUE)[vars]) %>% + dplyr::mutate( # Exception for columns of type difftime that is not supported by as_listing + dplyr::across( + dplyr::where(~ inherits(., what = "difftime")), ~ as.double(., units = "auto") + ) + ) table <- rlistings::as_listing( table, key_cols = NULL,