Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/testthat/test-aesthetics.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ test_that("color_scheme_view returns correct ggplot object", {
})

test_that("color_scheme_view returns gtable if length(scheme) >= 1", {
skip_if_not_installed("gridExtra")
expect_gtable(color_scheme_view(c("red", "gray")))
expect_gtable(color_scheme_view(c("red", "gray", "blue")))
})
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-bayesplot_grid.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
library(bayesplot)
context("bayesplot_grid")

skip_if_not_installed("gridExtra")

y <- example_y_data()
yrep <- example_yrep_draws()[1:25, ]
gr <- gridExtra::arrangeGrob(ppc_stat(y, yrep, binwidth = 1))
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-mcmc-scatter-and-parcoord.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test_that("mcmc_hex throws error if number of parameters is not 2", {

# mcmc_pairs -------------------------------------------------------------
test_that("mcmc_pairs returns a bayesplot_grid object", {
skip_if_not_installed("gridExtra")
g <- mcmc_pairs(arr, pars = c("(Intercept)", "sigma"))
expect_bayesplot_grid(g)
expect_equal(print(g), plot(g))
Expand All @@ -88,6 +89,7 @@ test_that("mcmc_pairs using hexbin works", {
})

test_that("no mcmc_pairs non-NUTS 'condition's fail", {
skip_if_not_installed("gridExtra")
expect_bayesplot_grid(
mcmc_pairs(arr, pars = "sigma", regex_pars = "beta",
condition = pairs_condition(chains = list(1, 2:4)))
Expand Down