context("NPS")
set.seed(10)
scores <- sample(0:10, 100, replace = TRUE)
test_that("the correct NPS is calculated", {
expect_equal(calc_nps(scores), -29)
})
test_that("the correct standard error is calculated", {
expect_equal(round(calc_nps_std_error(scores), 6), 8.519977)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.