From dcfe3f8132b13d904bd4ef72fbaf2411a79267d2 Mon Sep 17 00:00:00 2001 From: "Martin R. Smith" <1695515+ms609@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:55:53 +0000 Subject: [PATCH] Use `lengths()` --- R/tree_distance_kendall-colijn.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tree_distance_kendall-colijn.R b/R/tree_distance_kendall-colijn.R index 65f04a1a5..d88724941 100644 --- a/R/tree_distance_kendall-colijn.R +++ b/R/tree_distance_kendall-colijn.R @@ -148,7 +148,7 @@ KCVector <- function(tree) { mrca <- apply(is, 2, function(i) max(intersect(ancestors[[i[1]]], ancestors[[i[2]]]))) - rootDist <- vapply(ancestors, length, integer(1)) + rootDist <- lengths(ancestors) structure(rootDist[mrca], Size = nTip, class = "dist") }