context("test-thresholdfunctions")
test_that("soft-thresholding works", {
expect_equal(soft(3, 1), 2)
expect_equal(soft(-3, 1), -2)
expect_equal(soft(-1, 2), 0)
})
test_that("hard-thresholding works", {
expect_equal(hard(3, 1), 3)
expect_equal(hard(-3, 1), -3)
expect_equal(hard(-1, 2), 0)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.