diff --git a/R/plot_metrics.R b/R/plot_metrics.R index 49f39455e400ead1c7967639941d8ee56bffc0b2..de36e10ce75da342ee5723030daf8a482742c89e 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') +