mirror of
https://github.com/msberends/AMR.git
synced 2025-09-06 04:09:39 +02:00
(v1.6.0.9028) new unit test flow
This commit is contained in:
@@ -49,10 +49,12 @@ test_that("PCA works", {
|
||||
expect_s3_class(pca_model, "pca")
|
||||
|
||||
pdf(NULL) # prevent Rplots.pdf being created
|
||||
ggplot_pca(pca_model, ellipse = TRUE)
|
||||
ggplot_pca(pca_model, arrows_textangled = FALSE)
|
||||
if (suppressWarnings(require("ggplot2"))) {
|
||||
ggplot_pca(pca_model, ellipse = TRUE)
|
||||
ggplot_pca(pca_model, arrows_textangled = FALSE)
|
||||
}
|
||||
|
||||
if (require("dplyr")) {
|
||||
if (suppressWarnings(require("dplyr"))) {
|
||||
resistance_data <- example_isolates %>%
|
||||
group_by(order = mo_order(mo),
|
||||
genus = mo_genus(mo)) %>%
|
||||
@@ -60,7 +62,9 @@ test_that("PCA works", {
|
||||
pca_result <- resistance_data %>%
|
||||
pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, "SXT")
|
||||
expect_s3_class(pca_result, "prcomp")
|
||||
ggplot_pca(pca_result, ellipse = TRUE)
|
||||
ggplot_pca(pca_result, ellipse = FALSE, arrows_textangled = FALSE, scale = FALSE)
|
||||
if (suppressWarnings(require("ggplot2"))) {
|
||||
ggplot_pca(pca_result, ellipse = TRUE)
|
||||
ggplot_pca(pca_result, ellipse = FALSE, arrows_textangled = FALSE, scale = FALSE)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user