paul-buerkner / brms

Compare 28f778d ... +0 ... 8f3c7b6

Showing 1 of 1 files from the diff.

@@ -159,9 +159,15 @@
Loading
159 159
      regex <- paste0(",", regex, "\\]$")
160 160
      rpars <- rpars[grepl(regex, rpars)]
161 161
    }
162 -
    out[[g]] <- as.matrix(object, variable = rpars)
163 162
    levels <- attr(ranef, "levels")[[g]]
164 -
    dim(out[[g]]) <- c(nrow(out[[g]]), length(levels), length(coefs))
163 +
    if (length(rpars)) {
164 +
      # draws of varying coefficients were saved
165 +
      out[[g]] <- as.matrix(object, variable = rpars)
166 +
      dim(out[[g]]) <- c(nrow(out[[g]]), length(levels), length(coefs))
167 +
    } else {
168 +
      # draws of varying coefficients were not saved
169 +
      out[[g]] <- array(dim = c(ndraws(object), length(levels), length(coefs)))
170 +
    }
165 171
    dimnames(out[[g]])[2:3] <- list(levels, coefs)
166 172
    if (summary) {
167 173
      out[[g]] <- posterior_summary(out[[g]], probs, robust)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -<.01% 82.24%
Project Totals (70 files) 82.24%
Loading