Skip to content

Commit

Permalink
don't show smooth line by default, it fails too often
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 14, 2023
1 parent b3bd3e1 commit 52cc4e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: see
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
Version: 0.8.0.3
Version: 0.8.0.4
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
`method = "pointwise"`.
* Plot method for `performance::check_normality()` now default to a detrended
QQ-plot. Previous behavior can be restored by setting `type = "density"`.
* Plot method for `binned_residuals()` gains a `show_smooth` argument, to show
or hide the smooth line.

# see 0.8.0

Expand Down
3 changes: 2 additions & 1 deletion R/plot.binned_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plot.see_binned_residuals <- function(x,
size_line = 0.7,
size_point = 2.2,
colors = social_colors(c("blue", "red", "green")),
show_smooth = FALSE,
style = theme_lucid,
...) {
x$se.lo <- -x$se
Expand Down Expand Up @@ -44,7 +45,7 @@ plot.see_binned_residuals <- function(x,
p <- ggplot2::ggplot(data = x, ggplot2::aes(x = .data$xbar)) +
ggplot2::geom_abline(slope = 0, intercept = 0, colour = "grey80")

if (isTRUE(insight::check_if_installed("mgcv", quietly = TRUE))) {
if (isTRUE(insight::check_if_installed("mgcv", quietly = TRUE)) && show_smooth) {
p <- p +
ggplot2::stat_smooth(
ggplot2::aes(y = .data$ybar),
Expand Down

0 comments on commit 52cc4e9

Please sign in to comment.