Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Sep 4, 2024
1 parent 2604fe1 commit a872a71
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@
#' @keywords internal
.get_marginaleffects_draws <- function(object) {
# errors and checks are handled by marginaleffects
posterior_draws <- attr(object, "posterior_draws")
if (is.null(posterior_draws)) {
insight::format_warning("Could not find posterior draws. The object produced by the `marginaleffects` package was not based on a bayesian model.")
}
as.data.frame(t(posterior_draws))
insight::check_if_installed("marginaleffects")
data.frame(marginaleffects::posterior_draws(object, shape = "DxP"))
}

0 comments on commit a872a71

Please sign in to comment.