test_that("my_t_test throws an error when input is not valid", {
expect_error(my_t.test(rnorm(10, 0, 1), "a", 5))
expect_error(my_t.test("a", "less", 5))
expect_error(my_t.test(rnorm(10, 0, 1), "less", "5"))
})
test_that("my_t_test returns a list as output", {
expect_is(my_t.test(rnorm(10, 0, 1), "greater", 5), "list")
expect_is(my_t.test(rnorm(10, 0, 1), "less", 5), "list")
expect_is(my_t.test(rnorm(10, 0, 1), "two.sided", 5), "list")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.