tests/testthat/test_3_math.R

context("Testing math functions")

test_that("robust_zscore works properly", {
  x <- readRDS("rnorm20.rds")
  truth_rz <- readRDS("robust_zs_rnorm20.rds")
  test_rz <- robust_zscore(x)
  expect_identical(test_rz, truth_rz)
})

test_that("distil works properly", {
  m <- readRDS("rnorm_matrix.rds")
  truth_distil <- readRDS("distil_result.rds")
  test_distil <- distil(m)
  expect_identical(test_distil, truth_distil)
})

Try the cmapR package in your browser

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

cmapR documentation built on Dec. 12, 2020, 2 a.m.