test_that('freq_out gives a frequency table', {
# Success test 1
ychk <- as.data.frame(table(iris$Species))
yfun <- freq_out(iris$Species)
expect_identical(TRUE, all(ychk==yfun))
# Failure test 1
expect_error(freq_out(c(2)),'Input is a scalar; cannot be tabulated')
# Failure test 2
expect_error(freq_out(iris),'Input is not an atomic type')
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.