From 172e84cacacabecf6b54061879a3c5187cfd988e Mon Sep 17 00:00:00 2001 From: ecmerkle Date: Fri, 5 Jan 2024 08:52:40 -0600 Subject: [PATCH] add improved column names to posterior samples --- R/blav_object_inspect.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/blav_object_inspect.R b/R/blav_object_inspect.R index 7646508e..4211c779 100644 --- a/R/blav_object_inspect.R +++ b/R/blav_object_inspect.R @@ -91,13 +91,17 @@ blavInspect <- function(blavobject, what, ...) { draws <- make_mcmc(blavobject@external$mcmcout) draws <- lapply(draws, function(x) mcmc(x[, idx, drop = FALSE])) draws <- mcmc.list(draws) + if(add.labels) { + for (i in 1:length(draws)) { + colnames(draws[[i]]) <- labs + } + } if(what == "hpd"){ pct <- .95 if("level" %in% dotNames) pct <- dotdotdot$level if("prob" %in% dotNames) pct <- dotdotdot$prob draws <- mcmc(do.call("rbind", draws)) draws <- HPDinterval(draws, pct) - if(add.labels) rownames(draws) <- labs } draws } else if(what == "mcobj"){