Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 26, 2019
1 parent 5054352 commit 3d6014b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/parameters_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 3d6014b

Please sign in to comment.