Skip to content

Commit 16f67d4

Browse files
committed
improve backwards compatibility
1 parent 8625e10 commit 16f67d4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

R/loo_compare.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ loo_compare.default <- function(x, ...) {
175175
#' approximation based probability of each model having worse performance than
176176
#' the best model? The default is `TRUE`.
177177
print.compare.loo <- function(x, ..., digits = 1, p_worse = TRUE) {
178+
if (!inherits(x, "data.frame")) {
179+
class(x) <- c(class(x), "data.frame")
180+
}
178181
xcopy <- x
179182
if (NCOL(xcopy) >= 2) {
180183
xcopy <- xcopy[, c("elpd_diff", "se_diff")]

0 commit comments

Comments
 (0)