tests/testthat/test-feature-five-num.R

wages_five_num <- wages %>%
  features(ln_wages, feat_five_num)

test_that("feat_five_num returns the right names", {
  expect_equal(names(wages_five_num),
               c("id", "min", "q25", "med", "q75", "max"))
})

test_that("feat_five_num returns the right dimensions", {
  expect_equal(dim(wages_five_num),
               c(888, 6))
})

library(dplyr)
test_that("feat_five_num returns all ids", {
  expect_equal(n_distinct(wages_five_num$id), 888)
})

Try the brolgar package in your browser

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

brolgar documentation built on June 22, 2024, 11:24 a.m.