From 8136521aa6d35abd7ddf378eb91ab76de15823c3 Mon Sep 17 00:00:00 2001
From: aduvermy <arnaud.duvermy@ens-lyon.fr>
Date: Tue, 24 Oct 2023 16:19:15 +0200
Subject: [PATCH] density to histogram

---
 R/plot_metrics.R | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/R/plot_metrics.R b/R/plot_metrics.R
index 49f3945..de36e10 100644
--- a/R/plot_metrics.R
+++ b/R/plot_metrics.R
@@ -40,10 +40,10 @@ subset_glance <- function(glance_df, focus){
 #'   values include "AIC", "BIC", "logLik", "deviance", "df.resid", and
 #'   "dispersion". If \code{NULL}, all available metrics will be plotted.
 #'
-#' @return A ggplot object displaying density plots for the specified metrics.
+#' @return A ggplot object displaying histogram plots for the specified metrics.
 #'
 #' @importFrom reshape2 melt
-#' @importFrom ggplot2 aes facet_wrap geom_density theme_bw theme ggtitle
+#' @importFrom ggplot2 aes facet_wrap geom_histogram theme_bw theme ggtitle
 #'
 #' @export
 #'
@@ -59,7 +59,7 @@ metrics_plot <- function(l_tmb, focus = NULL) {
   }
   long_glance_df <- reshape2::melt(glance_df, variable.name = "metric")
   p <- ggplot2::ggplot(long_glance_df) +
-    ggplot2::geom_density(ggplot2::aes(x = value, col = metric, fill = metric), alpha = 0.4) +
+    ggplot2::geom_histogram(ggplot2::aes(x = value, col = metric, fill = metric)) +
     ggplot2::facet_wrap(~metric, scales = "free") +
     ggplot2::theme_bw() +
     ggplot2::theme(legend.position = 'null') + 
-- 
GitLab