diff --git a/R/parameters_table.R b/R/parameters_table.R index 3065fee1e..8171a1070 100644 --- a/R/parameters_table.R +++ b/R/parameters_table.R @@ -20,6 +20,7 @@ #' #' @importFrom tools toTitleCase #' @importFrom insight format_value +#' @importFrom stats na.omit #' @export parameters_table <- function(x, pretty_names = TRUE, stars = FALSE, ...) { x <- as.data.frame(x) @@ -52,7 +53,7 @@ parameters_table <- function(x, pretty_names = TRUE, stars = FALSE, ...) { ci_colname <- sprintf("%i%% CI", attributes(x)$ci * 100) } # Get characters to align the CI - max_len <- max(nchar(na.omit(c(round(x[[ci_low]], 2), round(x[[ci_high]], 2))))) + max_len <- max(nchar(stats::na.omit(c(round(x[[ci_low]], 2), round(x[[ci_high]], 2))))) for (i in 1:length(ci_colname)) { x[ci_colname[i]] <- format_ci(x[[ci_low[i]]], x[[ci_high[i]]], ci = NULL, width = max_len, brackets = TRUE) }