From 6add9d38b06fc73ecb2d3527af5c84a09bfae4ce Mon Sep 17 00:00:00 2001 From: Dan Chaltiel <15105152+DanChaltiel@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:19:55 +0100 Subject: [PATCH] grade should be numeric in ae_table_soc fixes #35 --- R/ae_table_soc.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/ae_table_soc.R b/R/ae_table_soc.R index 9a93bda..0214262 100644 --- a/R/ae_table_soc.R +++ b/R/ae_table_soc.R @@ -91,6 +91,9 @@ ae_table_soc = function( df_enrol = df_enrol %>% select(subjid_=any_of2(subjid), arm_=any_of2(arm)) %>% mutate(arm_ = if(is.null(.env$arm)) default_arm else .data$arm_) + if(!is.numeric(df_ae$grade)){ + cli_abort("Grade ({.val {grade}}) should be a numeric column.") + } df = df_enrol %>% left_join(df_ae, by="subjid_") %>%