strengejacke / sjPlot

sjPlot - Data Visualization for Statistics in Social Science
https://strengejacke.github.io/sjPlot
603 stars 91 forks source link

Error ci_style with typre="pred" for ggeffects version 1.3.2 #921

Closed benjaminschlegel closed 7 months ago

benjaminschlegel commented 8 months ago

Hi Daniel

ggeffects:::plot.ggalleffects() which is called with graphics::plot() changed it's parameter names form "."-style to "_"-style with the newest version 1.3.2. Therefore ci.style is now called ci_style (as well as other name changes. Therefore plot_model raises an error when used with type="pred" with arg.match ci_style.

Best, Benjamin

strengejacke commented 8 months ago

Yes, it seems that I forgot to keep the old argument names for that method, and only tested for the other plot() methods...

IsmetOzzer commented 7 months ago

Hi, has this issue been resolved by any chance? I am having the exact issue (which I didn't have last week, strange..)

strengejacke commented 7 months ago

Do you have a reproducible example? After updating ggeffects on CRAN, everything in sjPlot is still ok (https://cran.r-project.org/web/checks/check_results_sjPlot.html). Which particular example fails?

benjaminschlegel commented 7 months ago

Here is an example. Before I run it I updated ggeffects and sjPlot:

m = lm(lr_self ~ age + gender, data = glm.predict::selects2015)
sjPlot::plot_model(m, type = "pred")

I get the following error message:

Error in match.arg(ci_style) : 'arg' muss NULL oder ein Zeichenkettenvektor sein

IsmetOzzer commented 7 months ago

I did update the GitHub version of both ggeffects and sjPlot but no luck.

Basically, the problem is with the "pred" part. sjPlot::plot_model( lm(mpg ~ cyl, data = mtcars), type = "pred", show.data = T)

Error in match.arg(ci_style) : 'arg' must be NULL or a character vector

strengejacke commented 7 months ago

Thanks, should work after updating both sjPlot and ggeffects from GitHub:

sjPlot::plot_model(lm(mpg ~ cyl, data = mtcars), type = "pred", show.data = T)
#> 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 2023-11-23 with reprex v2.0.2