From 32136f03bce5f5c01f61397420fdd4029ec6a03b Mon Sep 17 00:00:00 2001 From: "Mattan S. Ben-Shachar" Date: Thu, 12 Dec 2024 21:53:15 +0200 Subject: [PATCH] use marginaleffects::get_draws #685 --- DESCRIPTION | 2 +- R/utils.R | 4 ++-- tests/testthat/test-marginaleffects.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fc72c6fa1..cbe8da2cd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -95,7 +95,7 @@ Suggests: lavaan, lme4, logspline (>= 2.1.21), - marginaleffects (>= 0.21.0), + marginaleffects (>= 0.24.0), MASS, mclust, mediation, diff --git a/R/utils.R b/R/utils.R index e8aa83116..9bf719549 100644 --- a/R/utils.R +++ b/R/utils.R @@ -293,8 +293,8 @@ #' @keywords internal .get_marginaleffects_draws <- function(object) { # errors and checks are handled by marginaleffects - insight::check_if_installed("marginaleffects") - data.frame(marginaleffects::posterior_draws(object, shape = "DxP")) + insight::check_if_installed("marginaleffects", minimum_version = "0.24.0") + data.frame(marginaleffects::get_draws(object, shape = "DxP")) } #' @keywords internal diff --git a/tests/testthat/test-marginaleffects.R b/tests/testthat/test-marginaleffects.R index a49c16f4d..8fb654499 100644 --- a/tests/testthat/test-marginaleffects.R +++ b/tests/testthat/test-marginaleffects.R @@ -1,7 +1,7 @@ skip_on_cran() skip_if_not_installed("withr") skip_if_not_installed("rstanarm") -skip_if_not_installed("marginaleffects") +skip_if_not_installed("marginaleffects", minimum_version = "0.24.0") skip_if_not_installed("collapse") withr::with_environment(