Skip to content
Snippets Groups Projects
Commit 8136521a authored by Arnaud Duvermy's avatar Arnaud Duvermy
Browse files

density to histogram

parent 78bb8521
Branches
Tags
No related merge requests found
......@@ -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') +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment