Skip to content

Commit

Permalink
Keep setting attributes for data.frames as well
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse committed Sep 28, 2024
1 parent 286a1dd commit 1885d87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/score.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ validate_scores <- function(scores) {
ret <- NextMethod()
if (is.data.table(ret)) {
setattr(ret, "metrics", attr(x, "metrics"))
} else if (is.data.frame(ret)) {
attr(ret, "metrics") <- attr(x, "metrics")
}
return(ret)
}

0 comments on commit 1885d87

Please sign in to comment.