1library(lme4) 2library(testthat) 3load(system.file("testdata","crabs_randdata00.Rda",package="lme4")) 4 5test_that('RZX is being calculated properly', { 6 # this is a test for an old problem, documented here: 7 # http://stevencarlislewalker.github.io/notebook/RZX_problems.html 8 fr <- cbind(final.snail.density, snails.lost) ~ crab.speciesS + crab.sizeS + 9 crab.speciesS:crab.sizeS + (snail.size | plot) 10 m <- glmer(fr, data = randdata00, family = binomial) 11 expect_that(m, is_a("glmerMod")) 12}) 13