Skip to content

Commit 3ed1c0c

Browse files
committed
improve backwards compatibility
1 parent dc9db69 commit 3ed1c0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/loo_compare.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ print.compare.loo <- function(x, ..., digits = 1, p_worse = TRUE) {
183183
if (!inherits(x, "data.frame")) {
184184
class(x) <- c(class(x), "data.frame")
185185
}
186+
if (!all(c("model", "elpd_diff", "se_diff") %in% colnames(x))) {
187+
print(as.data.frame(x))
188+
return(x)
189+
}
186190
x2 <- cbind(
187191
model = x$model,
188192
.fr(x[, c("elpd_diff", "se_diff")], digits)

0 commit comments

Comments
 (0)