tests/testthat/testsum_ff.R

library(testthat)
library(ff)

context("sum")

test_that("Sum ff works",{
  x <- runif(100)
  fx <- ff(x)
  expect_equal(sum(x), sum(fx))
})

test_that("Sum ff works with na=TRUE works",{
  x <- 1
  fx <- ff(x)
  expect_equal(sum(x, na.rm=TRUE), sum(fx, na.rm=TRUE))
})

Try the ffbase package in your browser

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

ffbase documentation built on Feb. 27, 2021, 5:06 p.m.