Skip to content

Commit 4ad6d32

Browse files
committed
fix
1 parent 7a5aa31 commit 4ad6d32

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* New function `collapse_by_group()`, which extracts the raw data points and
66
"averages" (i.e. "collapses") the response variable over the levels of the
7-
grouping factor given in `collapse_by`. Only works with mixed model.
7+
grouping factor given in `collapse_by`. Only works with mixed models.
88
Additionally, the `plot()` and `visualization_recipe()` methods get a
99
`collapse_group` argument to use this feature when adding data points to plots
1010
using `show_data` or `show_residuals`.

R/visualisation_recipe_internal.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,6 @@
604604
model <- attributes(x)$model
605605
rawdata <- collapse_by_group(x, model, collapse_by, residuals = show_residuals)
606606

607-
# Add response to data if not there
608-
y <- insight::find_response(model)
609-
if (!y %in% names(rawdata)) {
610-
rawdata[y] <- insight::get_response(model, verbose = FALSE)
611-
}
612-
613607
# if we have less than 8 values for the legend, a continuous color scale
614608
# is used by default - we then must convert values into factors, when we
615609
# show data or residuals - but we must ensure that the levels are sorted
@@ -630,7 +624,7 @@
630624
model = model,
631625
aes = aes,
632626
data = rawdata,
633-
y = y,
627+
y = insight::find_response(model),
634628
size = 2.5,
635629
jitter = 0.1
636630
)

0 commit comments

Comments
 (0)