tests/testthat/test-make_group_table.R

test_that("table has 3 rows on grouped iris (species)", {
  rowcount_tbl <- nrow(make_group_table(dplyr::group_by(iris, Species)))

  rowcount_dplyr <- dplyr::n_groups(dplyr::group_by(iris, Species))

  expect_identical(rowcount_tbl, rowcount_dplyr)
})

Try the datacleanr package in your browser

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

datacleanr documentation built on June 8, 2025, 10:27 a.m.