test_that("nonlinear model summary works", { skip_if_not_installed("nlme") set.seed(123) dat <- data.frame( id = factor(rep(1:5, each = 4)), x = rep(0:3, 5) ) dat$y <- 10 * (1 - exp(-0.5 * dat$x)) + rnorm(20, 0, 0.2) m <- fit_nlmm( model = y ~ SSasymp(x, Asym, R0, lrc), data = dat, fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1 | id, start = c( Asym = 10, R0 = 0, lrc = log(0.5) ), control = nlme::nlmeControl( maxIter = 100, msMaxIter = 200 ) ) s <- model_summary(m) expect_type(s, "list") expect_equal(s$model_type, "Nonlinear mixed-effects model") expect_true(is.numeric(s$n)) expect_true(is.finite(s$AIC)) expect_true(is.finite(s$BIC)) expect_true(is.numeric(s$logLik)) expect_true(is.numeric(s$fixed_effects)) expect_true(is.data.frame(s$random_effects)) })