Closed Deleetdk closed 4 months ago
Which version of ggeffects are you using? For me, your example works fine.
library(ggplot2)
library(ggeffects)
lm(Sepal.Length ~ Petal.Width + Species, data = iris) |>
ggpredict(terms = "Petal.Width") |>
plot(show_residuals = TRUE) +
ggtitle(NULL) +
theme_bw()
#> Data points may overlap. Use the `jitter` argument to add some amount of
#> random variation to the location of data points and avoid overplotting.
Created on 2024-05-18 with reprex v2.1.0
Please run ggeffects::install_latest()
and try again - does that help?
Oh, it's an issue of the magrittr-pipe:
library(magrittr)
library(ggplot2)
library(ggeffects)
lm(Sepal.Length ~ Petal.Width + Species, data = iris) %>%
ggpredict(terms = "Petal.Width") %>%
plot(show_residuals = TRUE) +
ggtitle(NULL) +
theme_bw()
#> Could not find model object to extract residuals.
Created on 2024-05-18 with reprex v2.1.0
I would close this as "invalid" - it works with the native R pipe, or maybe it can be fixed in magrittr?
Interesting. Good idea to check native pipe. I think closing is fine.
Ok, thanks!
Created on 2024-05-16 with reprex v2.1.0