From 73e40d58b01b36d18bffcf6a55df4dc7bd963f12 Mon Sep 17 00:00:00 2001 From: Witold Wolski Date: Mon, 26 Aug 2024 09:45:24 +0200 Subject: [PATCH] done --- R/tidyMS_plotting.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tidyMS_plotting.R b/R/tidyMS_plotting.R index 7489b12a..d4365104 100644 --- a/R/tidyMS_plotting.R +++ b/R/tidyMS_plotting.R @@ -540,7 +540,7 @@ plot_pca <- function(data , config, PC = c(1,2), add_txt = FALSE, plotly = FALSE ff <- t(ff) pca_result <- prcomp(ff) xx <- as_tibble(pca_result$x, rownames = config$table$sampleName) - if (max(PC) > ncol(xx)) { + if (max(PC) > (ncol(xx)-1)) { warning("nr of PCs: ", ncol(xx), "\n") return(NULL) }