Skip to content

Commit

Permalink
add some drop=FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmerkle committed Dec 21, 2023
1 parent d892348 commit 72fd52d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/blav_object_inspect.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ blavInspect <- function(blavobject, what, ...) {
pt$free[pt$op == ":="] <- max(pt$free, na.rm = TRUE) + 1:sum(pt$op == ":=")
labs <- lav_partable_labels(pt, type = "free")
draws <- make_mcmc(blavobject@external$mcmcout)
draws <- lapply(draws, function(x) mcmc(x[,idx]))
draws <- lapply(draws, function(x) mcmc(x[, idx, drop = FALSE]))
draws <- mcmc.list(draws)
if(what == "hpd"){
pct <- .95
Expand Down
2 changes: 1 addition & 1 deletion R/blav_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ make_mcmc <- function(mcmcout, stanlvs = NULL){
lavmcmc <- as.array(mcmcout)
lavmcmc <- lapply(seq(dim(lavmcmc)[2]), function(x) lavmcmc[,x,])
reord <- match(rownames(tmpsumm$summary), colnames(lavmcmc[[1]]))
lavmcmc <- lapply(lavmcmc, function(x) x[,reord])
lavmcmc <- lapply(lavmcmc, function(x) x[, reord, drop = FALSE])

if(is.array(stanlvs)){
stanlvs <- lapply(seq(dim(stanlvs)[2]), function(x) stanlvs[,x,])
Expand Down

0 comments on commit 72fd52d

Please sign in to comment.