tests/testthat/test_cleanup.R

context("cleanup")
library(testthat)
library(hmi)

#test_check("hmi")

test_that("data are cleaned correctly", {
  expect_equal(cleanup(iris, k = 10), iris)
  expect_equal(cleanup(iris, k = 2), iris[, -5])
  expect_equal(cleanup(InsectSprays, k = 10), InsectSprays)
  expect_equal(cleanup(InsectSprays, k = 5), InsectSprays[, -2, drop = FALSE])
})

Try the hmi package in your browser

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

hmi documentation built on Oct. 23, 2020, 7:31 p.m.