From c0782f4909afe73dcd7c186ac9d13afd31f3eb88 Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:19:13 -0400 Subject: [PATCH] fix warning --- R/dimension_reduction.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/dimension_reduction.R b/R/dimension_reduction.R index 33bdfc2cd..8fbe088b0 100644 --- a/R/dimension_reduction.R +++ b/R/dimension_reduction.R @@ -1821,10 +1821,12 @@ jackstrawPlot <- function(gobject, "\nnumber of estimated significant components: ", nr_sign_components) - warning(wrap_txt( - "Number of significant components equals `ncp`. + if (ncp <= nr_sign_components) { + warning(wrap_txt( + "Number of significant components equals `ncp`. Increasing `ncp` may be needed." - )) + )) + } final_results <- jtest[c("p", "cum_var_explained")] vmsg(.v = verbose, .is_debug = TRUE, final_results$p)