Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 1, 2023
1 parent 182a8ee commit 704d764
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
12 changes: 4 additions & 8 deletions R/hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
#' @family ci
#' @seealso Other interval functions, such as [hdi()], [eti()], [bci()], [spi()], [si()], [cwi()].
#'
#' @examples
#' @examplesIf require("rstanarm") && require("brms") && require("emmeans") && require("BayesFactor")
#' library(bayestestR)
#'
#' posterior <- rnorm(1000)
Expand All @@ -90,23 +90,19 @@
#' bayestestR::hdi(iris[1:4])
#' bayestestR::hdi(iris[1:4], ci = c(0.80, 0.90, 0.95))
#' \donttest{
#' library(rstanarm)
#' model <- suppressWarnings(
#' stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
#' rstanarm::stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
#' )
#' bayestestR::hdi(model)
#' bayestestR::hdi(model, ci = c(0.80, 0.90, 0.95))
#'
#' library(emmeans)
#' bayestestR::hdi(emtrends(model, ~1, "wt", data = mtcars))
#' bayestestR::hdi(emmeans::emtrends(model, ~1, "wt", data = mtcars))
#'
#' library(brms)
#' model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
#' bayestestR::hdi(model)
#' bayestestR::hdi(model, ci = c(0.80, 0.90, 0.95))
#'
#' library(BayesFactor)
#' bf <- ttestBF(x = rnorm(100, 1, 1))
#' bf <- BayesFactor::ttestBF(x = rnorm(100, 1, 1))
#' bayestestR::hdi(bf)
#' bayestestR::hdi(bf, ci = c(0.80, 0.90, 0.95))
#' }
Expand Down
12 changes: 5 additions & 7 deletions man/hdi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 704d764

Please sign in to comment.