library(testthat)
library(data.summary)
context("Sample Variance")
test_that("Calculated Correctly", {
x <- 1:10
expect_equal(sample_variance(x), 55/6)
y <- c( -3, 50, 5, -11, 4)
expect_equal(sample_variance(y),566.5)
z <- rnorm(20)
expect_equal(sample_variance(z), sd(z)^2)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.