From 0fd222debe00b6fd7450484b9e150b7b67c2b85d Mon Sep 17 00:00:00 2001 From: ms609 <1695515+ms609@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:49:54 +0100 Subject: [PATCH] ws --- R/median.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/median.R b/R/median.R index ae1574a2..58debd11 100644 --- a/R/median.R +++ b/R/median.R @@ -74,9 +74,13 @@ median.multiPhylo <- function(x, na.rm = FALSE, } else { chosen <- distances == min(distances) if (index) { - which(chosen) + which(chosen) } else { - if (sum(chosen) == 1L) x[[which(chosen)]] else x[chosen] + if (sum(chosen) == 1L) { + x[[which(chosen)]] + } else { + x[chosen] + } } } }