@@ -17,6 +17,7 @@ if (requireNamespace("rstanarm", quietly = TRUE)) {
1717test_that(" mcmc_scatter returns a ggplot object" , {
1818 expect_gg(mcmc_scatter(arr , pars = c(" beta[1]" , " beta[2]" )))
1919 expect_gg(mcmc_scatter(arr1chain , regex_pars = " beta" , size = 3 , alpha = 0.5 ))
20+ expect_gg(mcmc_scatter(drawsarr , pars = c(" theta[1]" , " theta[2]" )))
2021 expect_gg(mcmc_scatter(mat , pars = c(" sigma" , " (Intercept)" )))
2122 expect_gg(mcmc_scatter(dframe , regex_pars = " x:[2,4]" ))
2223 expect_gg(mcmc_scatter(dframe_multiple_chains ,
@@ -26,7 +27,9 @@ test_that("mcmc_scatter returns a ggplot object", {
2627test_that(" mcmc_scatter throws error if number of parameters is not 2" , {
2728 expect_error(mcmc_scatter(arr , pars = c(" sigma" , " beta[1]" , " beta[2]" )), " exactly 2 parameters" )
2829 expect_error(mcmc_scatter(arr , pars = " sigma" ), " exactly 2 parameters" )
30+ expect_error(mcmc_scatter(drawsarr , pars = " mu" ), " exactly 2 parameters" )
2931 expect_error(mcmc_scatter(arr1 ), " exactly 2 parameters" )
32+ expect_error(mcmc_scatter(drawsarr1 ), " exactly 2 parameters" )
3033 expect_error(mcmc_scatter(mat1 ), " exactly 2 parameters" )
3134})
3235
@@ -46,12 +49,14 @@ test_that("mcmc_hex returns a ggplot object", {
4649 skip_if_not_installed(" hexbin" )
4750 expect_gg(mcmc_hex(arr , pars = c(" beta[1]" , " beta[2]" )))
4851 expect_gg(mcmc_hex(arr1chain , regex_pars = " beta" , binwidth = c(.5 ,.5 )))
52+ expect_gg(mcmc_hex(drawsarr , pars = c(" theta[1]" , " theta[2]" )))
4953})
5054
5155test_that(" mcmc_hex throws error if number of parameters is not 2" , {
5256 skip_if_not_installed(" hexbin" )
5357 expect_error(mcmc_hex(arr , pars = c(" sigma" , " beta[1]" , " beta[2]" )), " exactly 2 parameters" )
5458 expect_error(mcmc_hex(arr , pars = " sigma" ), " exactly 2 parameters" )
59+ expect_error(mcmc_hex(drawsarr , pars = " mu" ), " exactly 2 parameters" )
5560 expect_error(mcmc_hex(arr1 ), " exactly 2 parameters" )
5661 expect_error(mcmc_hex(mat1 ), " exactly 2 parameters" )
5762})
@@ -69,8 +74,10 @@ test_that("mcmc_pairs returns a bayesplot_grid object", {
6974 diag_fun = " dens" , off_diag_fun = " hex" ,
7075 diag_args = list (trim = FALSE ),
7176 off_diag_args = list (binwidth = c(0.5 , 0.5 ))))
77+ expect_bayesplot_grid(mcmc_pairs(drawsarr , pars = " mu" , regex_pars = " theta" ))
7278
7379 expect_bayesplot_grid(suppressWarnings(mcmc_pairs(arr1chain , regex_pars = " beta" )))
80+ expect_bayesplot_grid(suppressWarnings(mcmc_pairs(drawsarr1chain , regex_pars = " theta" )))
7481 expect_bayesplot_grid(suppressWarnings(mcmc_pairs(mat , pars = c(" (Intercept)" , " sigma" ))))
7582 expect_bayesplot_grid(suppressWarnings(mcmc_pairs(dframe , pars = c(" (Intercept)" , " sigma" ))))
7683 expect_bayesplot_grid(mcmc_pairs(dframe_multiple_chains , regex_pars = " beta" ))
0 commit comments