From 96f5b84cb3f16157b77872f0e3ca7d9736401e3c Mon Sep 17 00:00:00 2001 From: mattpito <79466302+mattpito@users.noreply.github.com> Date: Wed, 8 Feb 2023 19:13:35 +0000 Subject: [PATCH] Update getStories.R Try to solve: Error in if (class(distance) != "matrix") distance = matrix(distance, : the condition has length > 1 --- R/getStories.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/getStories.R b/R/getStories.R index ecd5a1e..aa70ac5 100755 --- a/R/getStories.R +++ b/R/getStories.R @@ -922,7 +922,7 @@ mergeStories = function(clusteredStories, filteredStories, germlineVariants=c()) }) }) #if either as only one row, make it a 1-row or 1-column matrix. - if ( class(distance) != 'matrix' ) + if (any(class(distance) != 'matrix')) distance = matrix(distance, nrow = nrow(filteredStories)) closestDistance = apply(distance, 1, min) toMerge = which(closestDistance <= 1)