Skip to content

Commit 6ea15a3

Browse files
committed
Interpolate NAs with 1
1 parent 119be4a commit 6ea15a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/psis.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ prepare_psis_r_eff <- function(r_eff, len) {
362362
} else if (length(r_eff) != len) {
363363
stop("'r_eff' must have one value or one value per observation.", call. = FALSE)
364364
} else if (anyNA(r_eff)) {
365-
stop("Can't mix NA and not NA values in 'r_eff'.", call. = FALSE)
365+
message("If `r_eff` has length `len` but has `NA`s then `NA`s are replaced with 1's.")
366+
r_eff[is.na(r_eff)] <- 1
366367
}
367368
r_eff
368369
}

0 commit comments

Comments
 (0)