2

I recently updated to R version 3.5.0 and R Studio version 1.1.447 (Mac El Capitan 10.11.6). When I try to tidy (with the package broom) an object created with the package 'lmerTest' I get an error message:

 Error in vector(type, length) : 
  vector: cannot make a vector of mode 'NULL'. 

In earlier versions I didn't have this problem, this is what i did, which let to the error message:

library(lmerTest)
data(sleepstudy)
lmm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
library(broom)
tidy(lmm1)

Does anyone know a fix for this or can anyone maybe give an explanation what happens or what the issue is? When I use the lme4 package, all still works (but I want it to work with the 'lmerTest'-package).

Benjamin Telkamp
  • 1,451
  • 2
  • 17
  • 31

1 Answers1

0

This is quite old; as of now (and for a while), you can do this with broom.mixed::tidy().

library(broom.mixed)
tidy(lmm1)
 A tibble: 6 × 8
  effect   group    term            estimate std.error statistic    df   p.value
  <chr>    <chr>    <chr>              <dbl>     <dbl>     <dbl> <dbl>     <dbl>
1 fixed    NA       (Intercept)     251.          6.82     36.8   17.0  1.17e-17
2 fixed    NA       Days             10.5         1.55      6.77  17.0  3.26e- 6
3 ran_pars Subject  sd__(Intercept)  24.7        NA        NA     NA   NA       
4 ran_pars Subject  cor__(Intercep…   0.0656     NA        NA     NA   NA       
5 ran_pars Subject  sd__Days          5.92       NA        NA     NA   NA       
6 ran_pars Residual sd__Observation  25.6        NA        NA     NA   NA       
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453