library(Matrix)
library(lme4)
data <- lme4::sleepstudy
model1 <- lm(Reaction ~ Days, data = data)
model2 <- lmer(Reaction ~ 1+Days+(1+Days|Subject), data = data)
summary(model1)
summary(model2)
anova(model1, model2)
So I needed to update R to 4.0.2 and now comparing mixed effects models using the anova function returns an error. The error seems to appear when I assign the model because in the global environment it says "object with null pointer". The error seems only to appear using lmer and not with lm. Can anybody tell me how to fix this? I need at least R version 4.0.0 (my professor writes scripts that require this version).

