From 5f597c31ce76f02ec7027bcc299eaea37c531e13 Mon Sep 17 00:00:00 2001 From: ianhussey Date: Sun, 11 Nov 2018 22:20:56 +0000 Subject: [PATCH] consistent number of decimal places shown in forest plot --- R/forest.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/forest.R b/R/forest.R index 3968168..8b5ca13 100644 --- a/R/forest.R +++ b/R/forest.R @@ -74,11 +74,11 @@ forest <- function(model, samples_sum[[grouping]]) # Create text intervals samples_sum[["Interval"]] <- paste0( - round(samples_sum[["Estimate"]], digits), + format(round(samples_sum[["Estimate"]], digits), nsmall = digits), " [", - round(samples_sum[[lwr]], digits), + format(round(samples_sum[[lwr]], digits), nsmall = digits), ", ", - round(samples_sum[[upr]], digits), "]" + format(round(samples_sum[[upr]], digits), nsmall = digits), "]" ) # Order effects if (sort) samples_sum <- dplyr::arrange_(samples_sum, "type", "Parameter", "Estimate")