plot_model error: Error in pretty.default(c(floor(lower_lim), ceiling(upper_lim)))...
wthogmartin opened this issue · comments
I believe the issue is similar to #845 thought the error message differs
The error message in question:
Error in pretty.default(c(floor(lower_lim), ceiling(upper_lim))) :
7 arguments passed to .Internal(pretty) which requires 8
A reproducible example:
dt<-data.frame(y=rnorm(100),x=rnorm(100),z=rnorm(100), A=sample(c('group 1', 'group 2', 'group 3'), 100, replace=TRUE))
m0 <- lm(y ~ A*x + A*z, data=dt)
sjPlot::plot_model(m0)
sjPlot::plot_model(m0, type = "eff")
sjPlot::plot_model(m0, type = "pred")
m1 <- lm(y ~ x + z, data=dt)
sjPlot::plot_model(m1)
m2 <- lm(y~x, data=dt)
sjPlot::plot_model(m2)
all return the same error.
I've tried various 8 argument plots, but identifying which argument is missing has been unsuccessful so far
Cannot reproduce, works fine for me:
dt <-
data.frame(
y = rnorm(100),
x = rnorm(100),
z = rnorm(100),
A = sample(c('group 1', 'group 2', 'group 3'), 100, replace = TRUE)
)
m0 <- lm(y ~ A * x + A * z, data = dt)
sjPlot::plot_model(m0)
sjPlot::plot_model(m0, type = "eff")
#> $A
#>
#> $x
#>
#> $z
sjPlot::plot_model(m0, type = "pred")
#> $A
#>
#> $x
#>
#> $z
m1 <- lm(y ~ x + z, data = dt)
sjPlot::plot_model(m1)
m2 <- lm(y ~ x, data = dt)
sjPlot::plot_model(m2)
Created on 2022-07-31 by the reprex package (v2.0.1)
I should have indicated this earlier but I am working with R 4.2 and sjPlot 2.8.10.
The problem was resolved updating from R 4.2 to R 4.2.1