From 99ffb4fd44785dd9260d012805d03862b9760155 Mon Sep 17 00:00:00 2001 From: sl-eeper Date: Fri, 18 Oct 2024 04:44:20 +0000 Subject: [PATCH] fix error of returning p-value as list-> p-value to character --- R/forestglm.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/forestglm.R b/R/forestglm.R index 83a4c53..88c60cc 100644 --- a/R/forestglm.R +++ b/R/forestglm.R @@ -414,6 +414,8 @@ TableSubgroupMultiGLM <- function(formula, var_subgroups = NULL, var_cov = NULL, return(out.all) } else { out.list <- purrr::map(var_subgroups, ~ TableSubgroupGLM(formula, var_subgroup = ., var_cov = var_cov, data = data, family = family, decimal.estimate = decimal.estimate, decimal.percent = decimal.percent, decimal.pvalue = decimal.pvalue)) + out.list <- purrr::map(out.list, ~ .x %>% + dplyr::mutate(`P value` = purrr::map_chr(`P value`, ~ if(is.list(.)) as.character(unlist(.)) else as.character(.)))) if (line) { out.newline <- out.list %>% purrr::map(~ rbind(NA, .)) return(rbind(out.all, out.newline %>% dplyr::bind_rows()))