From 89bbaa71125b983d9f1d4284fc429d6eaf97a53e Mon Sep 17 00:00:00 2001 From: Max-Bladen Date: Thu, 17 Nov 2022 11:53:00 +1100 Subject: [PATCH] Fix for Issue #270 tests: added test for `plotIndiv.mint.plsda()` with `ellipse = TRUE` --- tests/testthat/test-plotIndiv.R | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/testthat/test-plotIndiv.R b/tests/testthat/test-plotIndiv.R index 2910521e..c82f8469 100644 --- a/tests/testthat/test-plotIndiv.R +++ b/tests/testthat/test-plotIndiv.R @@ -167,5 +167,20 @@ test_that("plotIndiv.sgccda(..., blocks = 'average') works with ellipse=TRUE", c expect_true(all(unique(diablo_plot$df.ellipse$Block) %in% c('average', 'Block: mrna', 'average (weighted)'))) }) +test_that("plotIndiv.mint.plsda() works with ellipse=TRUE", code = { + + data(stemcells) + X <- stemcells$gene + Y <- stemcells$celltype + S <- stemcells$study + + model <- mint.plsda(X, Y, study = S) + + pl.res <- plotIndiv(model, ellipse = T) + + .expect_numerically_close(pl.res$graph$data$x[10], -3.129) + .expect_numerically_close(pl.res$graph$data$y[20], -5.3516) +}) + unlink(list.files(pattern = "*.pdf"))