From 0dd16594888c7337c18c91212b170157f193494c Mon Sep 17 00:00:00 2001 From: seraidarian Date: Tue, 30 Jul 2024 15:25:55 +0300 Subject: [PATCH] Correct example & added length-1 reducedDim slot autodetection --- R/plotLoadings.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/plotLoadings.R b/R/plotLoadings.R index a99998e..23a2cf9 100644 --- a/R/plotLoadings.R +++ b/R/plotLoadings.R @@ -89,7 +89,7 @@ #' #' # Plotting after performing LDA method #' tse <- addLDA(tse) -#' plotLoadings(tse, dim = "LDA") +#' plotLoadings(tse, dimred = "LDA", ncomponents = 2) NULL #' @rdname plotLoadings @@ -109,8 +109,11 @@ setMethod("plotLoadings", signature = c(x = "TreeSummarizedExperiment"), tree.name = "phylo", class = rownames(x), ...) { + + if (length(reducedDimNames(x)) == 1) { + dimred <- reducedDimNames(x) + } - # Making sure there is no error in parameters given by the user .check_parameters(x, dimred = dimred,