library(GSignTest)
context("depthDistribution")
test_that("ddepth", {
expect_type(ddepth(0.1, 30, K = 2), "double")
expect_type(ddepth(0.1, 30, K = 3), "double")
expect_type(ddepth(0.1, 30, K = 4), "double")
expect_type(ddepth(0.1, 30, K = 5), "double")
expect_equal(ddepth(0.1, 30), ddepth(0.1, 30, K = 3))
expect_equal(ddepth(0.1, 100), ddepth(0.1, 200))
expect_equal(ddepth(-0.1, 30), 0)
expect_error(ddepth(0.1, 2))
expect_error(ddepth(0.1, 30, K = 6))
})
test_that("qdepth", {
expect_type(qdepth(0.1, 30, K = 2), "double")
expect_type(qdepth(0.1, 30, K = 3), "double")
expect_type(qdepth(0.1, 30, K = 4), "double")
expect_type(qdepth(0.1, 30, K = 5), "double")
expect_equal(qdepth(0.1, 30), qdepth(0.1, 30, K = 3))
expect_equal(qdepth(0.1, 100), qdepth(0.1, 200))
expect_equal(qdepth(0.1, 30, transform = TRUE), 30 * (qdepth(0.1, 30) - 1/4))
expect_error(qdepth(-0.1, 30))
expect_error(qdepth(1.5, 30))
expect_error(qdepth(0.1, 2))
expect_error(qdepth(0.1, 30, K = 6))
})
test_that("pdepth", {
expect_type(pdepth(0.1, 30, K = 2), "double")
expect_type(pdepth(0.1, 30, K = 3), "double")
expect_type(pdepth(0.1, 30, K = 4), "double")
expect_type(pdepth(0.1, 30, K = 5), "double")
expect_equal(pdepth(0.1, 30), pdepth(0.1, 30, K = 3))
expect_equal(pdepth(0.1, 100), pdepth(0.1, 200))
expect_equal(pdepth(-0.1, 30), 0)
expect_equal(pdepth(1.5, 30), 1)
expect_error(pdepth(0.1, 2))
expect_error(pdepth(0.1, 30, K = 6))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.