Skip to content

Commit 6cc4893

Browse files
committed
only call stan_glm in example if rstanarm installed
1 parent 0705d45 commit 6cc4893

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

R/E_loo.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#'
5252
#' @examples
5353
#' \donttest{
54+
#' if (requireNamespace("rstanarm", quietly = TRUE)) {
5455
#' # Use rstanarm package to quickly fit a model and get both a log-likelihood
5556
#' # matrix and draws from the posterior predictive distribution
5657
#' library("rstanarm")
@@ -81,6 +82,7 @@
8182
#' # log-likelihood values using the log_ratios argument.
8283
#' E_loo(yrep, psis_object, type = "mean", log_ratios = log_ratios)
8384
#' }
85+
#' }
8486
#'
8587
E_loo <- function(x, psis_object, ...) {
8688
UseMethod("E_loo")

man/E_loo.Rd

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

0 commit comments

Comments
 (0)