tests/testthat/test-do_by.R

describe("do_by",{
  tbl <- dbplyr::memdb_frame( id  = letters[c(1,1,2)]
                            , age = c(14, 18, 11)
                            )
  df <- as.data.frame(tbl)
  
  it("works with mean_by",{
    rules <- validator(mean_by(age, id) > 12)
    cf <- confront(tbl, rules, key = "id", sparse=TRUE)
    unsparse(cf)
  })
})
data-cleaning/validatedb documentation built on June 11, 2022, 4:33 p.m.