Skip to content

Commit

Permalink
allow attr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 24, 2023
1 parent a60e1a4 commit 79ea5de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/plot.binned_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ plot.see_binned_residuals <- function(x,

# set defaults
term <- attr(x, "term", exact = TRUE)
if (is.null(dots[["show_dots"]])) {
show_dots <- isTRUE(attr(x, "show_dots", exact = TRUE))
} else {
show_dots <- isTRUE(dots[["show_dots"]])
}

if (missing(style) && !is.null(attr(x, "theme"))) {
theme_style <- unlist(strsplit(attr(x, "theme"), "::", fixed = TRUE))
Expand All @@ -36,7 +41,7 @@ plot.see_binned_residuals <- function(x,
}

# show or hide dots - may be useful for large models with many observations
if (!isTRUE(dots[["show_dots"]]) && insight::n_unique(x$group) > 1) {
if (!show_dots && insight::n_unique(x$group) > 1) {
x$ybar[x$group == "yes"] <- NA
x$CI_low[x$group == "yes"] <- NA
x$CI_high[x$group == "yes"] <- NA
Expand Down

0 comments on commit 79ea5de

Please sign in to comment.