Skip to content

Commit

Permalink
Fix {see} related error (#42)
Browse files Browse the repository at this point in the history
* Fix for assumptions not showing when running check_assumptions
* Update plot assumption code
  • Loading branch information
cedricbatailler authored Feb 23, 2024
1 parent 2191bec commit 73c40cf
Show file tree
Hide file tree
Showing 3 changed files with 2,665 additions and 2,650 deletions.
4 changes: 2 additions & 2 deletions R/check_assumptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ check_assumptions.mediation_model <-
check_model <- function(model_name, model, tests) {
cat(model_name, sep = "\n")
if ("normality" %in% tests) {
performance::check_normality(model)
print(performance::check_normality(model))
}
if ("heteroscedasticity" %in% tests) {
performance::check_heteroscedasticity(model)
print(performance::check_heteroscedasticity(model))
}
if ("outliers" %in% tests) {
print(performance::check_outliers(model)) # without print, check_outliers
Expand Down
15 changes: 7 additions & 8 deletions R/plot_assumptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,11 @@ check_model_plot <- function(model, title, tests_to_perform) {
format()

# plot the assumptions
assumption_plot <-
plot(performance::check_model(model, check = tests_to_perform))

assumption_plot +
patchwork::plot_annotation(title = title,
subtitle =
glue::glue("Model formula: {model_formula}"),
)
assumption_plots <-
performance::check_model(model, check = tests_to_perform, panel = FALSE)

see::plots(
plot(assumption_plots),
title = glue::glue("Model formula: {model_formula}")
)
}
Loading

0 comments on commit 73c40cf

Please sign in to comment.