Debian Codegraph @

tests/testthat/test-aov.R

raw
1 library(broom)
2
3 d <- data.frame(
4 y = c(3, 4, 3.5, 4.1, 6, 7),
5 group = c("a", "b", "a", "b", "c", "c")
6 )
7 m <- aov(y ~ group, data = d)
8
9 test_that("glance.aov", {
10 glance_df <- glance(m)
11
12 expect_equal(glance_df$logLik, -1.752246, tolerance = 0.001)
13 expect_equal(glance_df$AIC, 11.50449, tolerance = 0.001)
14 expect_equal(glance_df$BIC, 10.67153, tolerance = 0.001)
15 expect_equal(glance_df$deviance, 0.6300, tolerance = 0.001)
16 expect_equal(glance_df$nobs, 6L)
17 })