test_that("multiplication works", {
expect_equal(2 * 2, 4)
})
test_that("centre works", {
expect_equal(centre(matrix(seq(1:9), nrow = 3)), centre(3 * matrix(seq(1:9), nrow = 3), T))
})
test_that("pca works",{
data(iris)
ref <- pca(iris[-5], F, 0.999)
expect_equal(prcomp(iris[-5])$rotation, pca(iris[-5], F, 0.999)$pca_directions)
# check methods don't produce errors
print(ref)
summary(ref)
plot(ref)
screeplot(ref)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.