context("Testing Coin Analytics")
test_that("Testing streaks", {
x <- streaks(c("H", "H", "T", "H", "T", "T", "T"))
expect_equal(x, c(2,3))
set.seed(2018)
x <- coin()
y <- toss(x, 50)
out <- streaks(y)
expect_equal(max(out$runs),6)
})
test_that("Testing summary statistics ", {
x <- coin()
set.seed(2018)
y <- toss(x, 10)
expect_equal(sum(y),3)
expect_equal(mean(y), 0.3)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.