tests/testthat/test-split-apply-combine-level.R

context("sac_level()")

test_that("base case",{

  out <- fabricate(sleep, sleep=modify_level(by="group", ybar=mean(extra)))

  # ybar constant within group
  expect_true(all(tapply(out$ybar, out$group, function(x) all(x == x[1]))))


})

Try the fabricatr package in your browser

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

fabricatr documentation built on June 29, 2022, 5:05 p.m.