From 1ccfe3846026c78bc1410abeedb53e05bfa8d957 Mon Sep 17 00:00:00 2001 From: jamesaazam Date: Tue, 12 Sep 2023 23:13:48 +0100 Subject: [PATCH] Assign final value to return the right copy --- R/likelihood.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/likelihood.R b/R/likelihood.R index 79ed452a..ab72099f 100644 --- a/R/likelihood.R +++ b/R/likelihood.R @@ -144,7 +144,7 @@ likelihood <- function(chains, statistic = c("size", "length"), offspring_dist, ## multiply the likelihoods if (isFALSE(individual)) { summarise_func <- ifelse(log, sum, prod) - vapply(chains_likelihood, summarise_func, 0) + chains_likelihood <- vapply(chains_likelihood, summarise_func, 0) } return(chains_likelihood)