tests/testthat/test_sumup.R

library(dplyr)
library(stringr)
library(statar)
context("sumup")


test_that("sum_up", {
  a <- cars %>% sum_up(speed)
  expect_equal(nrow(cars %>% sum_up(speed)), 1)
  expect_equal(nrow(cars %>% group_by(ok = speed %/% 10) %>% sum_up(dist)), 3)
})

Try the statar package in your browser

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

statar documentation built on Aug. 19, 2023, 5:09 p.m.