tests/testthat/test_performeR.R

library(PCRedux)

context("performeR")

test_that("performeR gives the correct dimensions and properties", {
  test_data <- c(0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1)
  reference_data <- c(0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1)
  res_performeR <- performeR(sample = test_data, reference = reference_data)

  expect_that(res_performeR, is_a("data.frame"))
  expect_that(res_performeR$TP == 10 && res_performeR$TP == 10 && res_performeR$SPC == 1, is_true())
})

Try the PCRedux package in your browser

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

PCRedux documentation built on May 11, 2022, 5:18 p.m.