Skip to content

Commit bb77a17

Browse files
authored
Promote rfx_beta_draws to consistent array dimensions in predict.bcf
Ensure rfx_beta_draws has consistent dimensions when there's one rfx term.
1 parent 32acbd1 commit bb77a17

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/bcf.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3162,6 +3162,11 @@ predict.bcfmodel <- function(
31623162
rfx_beta_draws <- rfx_param_list$beta_samples *
31633163
object$model_params$outcome_scale
31643164

3165+
# Promote to an array with consistent dimensions when there's one rfx term
3166+
if (length(dim(rfx_beta_draws)) == 2) {
3167+
dim(rfx_beta_draws) <- c(1, dim(rfx_beta_draws))
3168+
}
3169+
31653170
# Construct a matrix with the appropriate group random effects arranged for each observation
31663171
rfx_predictions_raw <- array(
31673172
NA,

0 commit comments

Comments
 (0)