tests/testthat/test-converged.R

library(buildmer)
library(testthat)
test_that('converged',{
	skip_on_cran()
	library(lme4)
	good1 <- lm(Reaction ~ Days,sleepstudy)
	good2 <- lmer(Reaction ~ Days + (Days|Subject),sleepstudy)
	bad <- suppressWarnings(lmer(Reaction ~ Days + (Days|Subject),sleepstudy,control=lmerControl(optimizer='bobyqa',optCtrl=list(maxfun=1))))
	expect_equal(sapply(list(good1,good2,bad),converged),c(TRUE,TRUE,FALSE))
})

Try the buildmer package in your browser

Any scripts or data that you put into this service are public.

buildmer documentation built on Oct. 25, 2023, 9:08 a.m.