tests/testthat/test-build.formula.R

library(buildmer)
library(testthat)
test_that('build.formula',{
	form1 <- Reaction ~ Days + (Days|Subject)
	terms <- tabulate.formula(form1)
	form2 <- build.formula(dep='Reaction',terms)
	library(lme4)
	check <- function (f) resid(lmer(f,sleepstudy))
	expect_equal(check(form1),check(form2))
})

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.