From 02e31936abe1673294ea770fa62f7970bcd208a2 Mon Sep 17 00:00:00 2001 From: Klaus Schliep Date: Thu, 7 Mar 2024 08:17:43 +0100 Subject: [PATCH] bug fix --- R/ancestral_pml.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ancestral_pml.R b/R/ancestral_pml.R index 1c70afc8..328d9daf 100644 --- a/R/ancestral_pml.R +++ b/R/ancestral_pml.R @@ -234,8 +234,8 @@ ancestral.pars <- function(tree, data, type = c("MPR", "ACCTRAN", "POSTORDER"), ind <- identical_sites(data) if(length(ind)>0){ for(k in (Ntip(tree)+1L):length(res)){ - if(return=="prob") result[[k]][ind,] <- result[[1]][ind,] - else result[[k]][ind] <- data[[1]][ind] + if(return=="prob") res[[k]][ind,] <- res[[1]][ind,] + else res[[k]][ind] <- data[[1]][ind] } } res