Skip to content

Commit 0705d45

Browse files
committed
mention how to specify names in loo_compare doc
1 parent ca3e225 commit 0705d45

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

R/loo_compare.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
#' `print(..., simplify=FALSE)` to print a more detailed summary.
77
#'
88
#' @export
9-
#' @param x An object of class `"loo"` or a list of such objects.
10-
#' @param ... Additional objects of class `"loo"`.
9+
#' @param x An object of class `"loo"` or a list of such objects. If a list is
10+
#' used then the list names will be used as the model names in the output. See
11+
#' **Examples**.
12+
#' @param ... Additional objects of class `"loo"`, if not passed in as a single
13+
#' list.
1114
#'
1215
#' @return A matrix with class `"compare.loo"` that has its own
1316
#' print method. See the **Details** section.
@@ -55,8 +58,9 @@
5558
#' # (will be the same for all models in this artificial example)
5659
#' print(comp, simplify = FALSE, digits = 3)
5760
#'
58-
#' # can use a list of objects
59-
#' loo_compare(x = list(loo1, loo2, loo3))
61+
#' # can use a list of objects with custom names
62+
#' # will use apple, banana, and cherry, as the names in the output
63+
#' loo_compare(list("apple" = loo1, "banana" = loo2, "cherry" = loo3))
6064
#'
6165
#' \dontrun{
6266
#' # works for waic (and kfold) too

man/loo_compare.Rd

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)