From 37869cfe9df9b7ef0ff362fb62af1d107f8ee3c1 Mon Sep 17 00:00:00 2001 From: Jacob Long Date: Mon, 29 Jul 2024 00:29:09 -0400 Subject: [PATCH] Check for summ method without breaking everything --- R/simple_slopes.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/simple_slopes.R b/R/simple_slopes.R index ad10bd9..22f9bc8 100644 --- a/R/simple_slopes.R +++ b/R/simple_slopes.R @@ -197,6 +197,8 @@ sim_slopes <- function(model, pred, modx, mod2 = NULL, modx.values = NULL, ss <- structure(ss, digits = digits) d <- get_data(model) + # see if jtools::summ() knows about this model + has_summ <- check_method(summ, model) if (is_survey <- inherits(model, "svyglm")) { design <- model$survey.design } else {design <- NULL} @@ -243,8 +245,7 @@ sim_slopes <- function(model, pred, modx, mod2 = NULL, modx.values = NULL, c(sapply(pred_names, function(x) paste0(x, ulevels(d[[pred]])))) } } - # see if jtools::summ() knows about this model - has_summ <- check_method(summ, model) + # use tidy on the model to get the term names tidied <- try(generics::tidy(model), silent = TRUE) # if there was no method, see if it's because it's a mixed model