From 280295211fca0f45967235aa35c24018fc73b606 Mon Sep 17 00:00:00 2001 From: Bradley Broom Date: Mon, 26 Apr 2021 22:38:41 -0600 Subject: [PATCH 1/3] Check whether any class of x is dist class(x) returns a character vector. When that vector was longer than one, the original code just checked the first element for a match to "dist" and issued a warning. Happens in common case where x is a matrix (and array). This patch removes the warning for objects with multiple classes. It also fixes a bug when object's first class is not "dist" but a subsequent one is. --- R/Rclusterpp.hclust.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Rclusterpp.hclust.R b/R/Rclusterpp.hclust.R index 8fd2fd2..ea9bc04 100644 --- a/R/Rclusterpp.hclust.R +++ b/R/Rclusterpp.hclust.R @@ -20,7 +20,7 @@ Rclusterpp.hclust <- function(x, method="ward", members=NULL, distance="euclidea if (method == -1) stop("Ambiguous clustering method") - if (class(x) == "dist") { + if (any(class(x)=="dist")) { dist.method = attributes(x)$method labels = attributes(x)$Labels From f1a54152a3d8bf17e971d4a0737d84976529e198 Mon Sep 17 00:00:00 2001 From: Bradley Broom Date: Mon, 26 Apr 2021 22:39:39 -0600 Subject: [PATCH 2/3] Add markdown to Suggests:: so that package passes check --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 56aa3e3..f407654 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ Description: Provide flexible native clustering routines that can be License: MIT + file LICENSE Depends: R (>= 2.12.0), Rcpp (>= 0.10.4) LinkingTo: Rcpp, RcppEigen -Suggests: RUnit, rbenchmark, fastcluster, inline, knitr +Suggests: RUnit, rbenchmark, fastcluster, inline, knitr, markdown URL: https://github.com/nolanlab/Rclusterpp BugReports: https://github.com/nolanlab/Rclusterpp/issues NeedsCompilation: yes From 9478e39cfb2ad0d5560c22c6e9e3f0804f548261 Mon Sep 17 00:00:00 2001 From: Bradley Broom Date: Mon, 31 May 2021 07:52:29 -0500 Subject: [PATCH 3/3] Add rmarkdown as a Suggests --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f407654..5781da7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ Description: Provide flexible native clustering routines that can be License: MIT + file LICENSE Depends: R (>= 2.12.0), Rcpp (>= 0.10.4) LinkingTo: Rcpp, RcppEigen -Suggests: RUnit, rbenchmark, fastcluster, inline, knitr, markdown +Suggests: RUnit, rbenchmark, fastcluster, inline, knitr, markdown, rmarkdown URL: https://github.com/nolanlab/Rclusterpp BugReports: https://github.com/nolanlab/Rclusterpp/issues NeedsCompilation: yes