test_that("Input is not a matrix", {
ca_info <- run_ca(tcga_meta_clean)
# Error expected.
expect_error(plot_factor_scores(as.data.frame(ca_info$fi_mat)),
"Factor scores are not in a matrix.")
})
test_that("Use optional parameter", {
ca_info <- run_ca(tcga_meta_clean)
# Error not expected.
expect_error(plot_factor_scores(ca_info$fi_mat, num_factors = 5), NA)
})
test_that("Do not use optional parameter", {
ca_info <- run_ca(tcga_meta_clean)
# Error not expected.
expect_error(plot_factor_scores(ca_info$fi_mat), NA)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.