Skip to content

Commit

Permalink
namespace count instead of loading tidyr with library()
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Aug 8, 2023
1 parent 40ec24f commit dc6f889
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/testthat/test_grouped_glm.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
library(tidyr)

test_that('correct results for glm_grouped()', {
ucb_weighted <- as.data.frame(UCBAdmissions)
ucb_weighted$Freq <- as.integer(ucb_weighted$Freq)

ucb_long <- uncount(ucb_weighted, Freq)
ucb_long <- tidyr::uncount(ucb_weighted, Freq)

ungrouped <- glm(Admit ~ Gender + Dept, data = ucb_long, family = binomial)

expect_error(
grouped <- glm_grouped(Admit ~ Gender + Dept, data = ucb_weighted, weights = ucb_weighted$Freq),
regexp = NA
)
expect_equal(grouped$df.null, 11)

expect_equal(grouped$df.null, 11)
})

0 comments on commit dc6f889

Please sign in to comment.