Skip to content

Commit

Permalink
Check for summ method without breaking everything
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-long committed Jul 29, 2024
1 parent 1a3336b commit 37869cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/simple_slopes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 37869cf

Please sign in to comment.