easystats / see

:art: Visualisation toolbox for beautiful and publication-ready figures
https://easystats.github.io/see/
Other
890 stars 45 forks source link

Error in model_parameters.aov plot() method? #286

Open jmgirard opened 1 year ago

jmgirard commented 1 year ago

Perhaps the intention is to have people use lm() not aov() but perhaps the error message can be updated.

library(easystats)
#> # Attaching packages: easystats 0.6.0.9
#> ✔ bayestestR  0.13.1      ✔ correlation 0.8.4    
#> ✔ datawizard  0.7.1.6     ✔ effectsize  0.8.3.11 
#> ✔ insight     0.19.1.12   ✔ modelbased  0.8.6.3  
#> ✔ performance 0.10.3.3    ✔ parameters  0.21.0.2 
#> ✔ report      0.5.7.4     ✔ see         0.7.5.5
x <- aov(Sepal.Length ~ Species, data = iris)
mp <- model_parameters(x)
plot(mp)
#> Error in `$<-.data.frame`(`*tmp*`, "Estimate_CI", value = character(0)): replacement has 0 rows, data has 2

y <- lm(Sepal.Length ~ Species, data = iris)
mp2 <- model_parameters(y)
plot(mp2)

Created on 2023-05-21 with reprex v2.0.2

strengejacke commented 1 year ago

We should "disable" plot for Anova objects, as they probably don't contain any useful information to plot?

bwiernik commented 1 year ago

We could also change the behavior of model_parameters() for them to show the same results as lm?

And maybe make a new function for generating ANOVA tables?