From fd3148d4711f8f0d2627b16a0becaeff2d2eab01 Mon Sep 17 00:00:00 2001 From: Dominique Makowski Date: Mon, 2 Dec 2024 13:45:49 +0000 Subject: [PATCH] fix wrong detection --- R/cor_sort.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/cor_sort.R b/R/cor_sort.R index baaf5625..f686ae11 100644 --- a/R/cor_sort.R +++ b/R/cor_sort.R @@ -78,7 +78,7 @@ cor_sort.easycormatrix <- function(x, distance = "correlation", hclust_method = #' @export cor_sort.matrix <- function(x, distance = "correlation", hclust_method = "complete", ...) { - if(isSquare(x)) { + if(isSquare(x) & all(colnames(x) %in% rownames(x))) { i <- .cor_sort_square(x, distance = distance, hclust_method = hclust_method, ...) } else { i <- .cor_sort_nonsquare(x, distance = "euclidean", ...)