Skip to content

Commit b006832

Browse files
committed
Merge branch 'master' into ridgeline-size
2 parents e908354 + 12b4188 commit b006832

19 files changed

+117
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
inst/doc
66

77
tests/testthat/Rplots.pdf
8+
tests/testthat/_snaps/
89

910
.DS_Store
1011

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Imports:
3131
ggplot2 (>= 3.0.0),
3232
ggridges,
3333
glue,
34+
posterior,
3435
reshape2,
3536
rlang (>= 0.3.0),
3637
stats,
@@ -53,7 +54,7 @@ Suggests:
5354
survival,
5455
testthat (>= 2.0.0),
5556
vdiffr
56-
RoxygenNote: 7.1.1
57+
RoxygenNote: 7.1.2
5758
VignetteBuilder: knitr
5859
Encoding: UTF-8
5960
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# bayesplot 1.8.1.9000
44

5+
* `mcmc_*()` functions now support all draws formats from the **posterior** package. (#277, @Ozan147)
6+
57
* `mcmc_dens()` and `mcmc_dens_overlay()` gain arguments for controlling the
68
the density calculation. (#258)
79

R/helpers-mcmc.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ prepare_mcmc_array <- function(x,
99
pars = character(),
1010
regex_pars = character(),
1111
transformations = list()) {
12-
if (is_df_with_chain(x)) {
12+
if (posterior::is_draws(x)) {
13+
x <- posterior::as_draws_array(x)
14+
} else if (is_df_with_chain(x)) {
1315
x <- df_with_chain2array(x)
1416
} else if (is_chain_list(x)) {
1517
# this will apply to mcmc.list and similar objects

R/mcmc-overview.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#' have already been merged), or a data frame with one column per parameter plus
2626
#' an additional column `"Chain"` that contains the chain number (an integer)
2727
#' corresponding to each row in the data frame.
28+
#' * __draws__: Any of the `draws` formats supported by the
29+
#' \pkg{\link{posterior}} package.
2830
#'
2931
#' __Note__: typically the user should *not* include warmup iterations
3032
#' in the object passed to **bayesplot** plotting functions, although for

man-roxygen/args-mcmc-x.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
#' @param x A 3-D array, matrix, list of matrices, or data frame of MCMC draws.
2-
#' The [MCMC-overview] page provides details on how to specify each these
3-
#' allowed inputs. It is also possible to use an object with an
4-
#' `as.array()` method that returns the same kind of 3-D array described on
5-
#' the [MCMC-overview] page.
1+
#' @param x An object containing MCMC draws:
2+
#' * A 3-D array, matrix, list of matrices, or data frame. The [MCMC-overview]
3+
#' page provides details on how to specify each these.
4+
#' * A `draws` object from the \pkg{\link{posterior}} package (e.g.,
5+
#' `draws_array`, `draws_rvars`, etc.).
6+
#' * An object with an `as.array()` method that returns the same kind of 3-D
7+
#' array described on the [MCMC-overview] page.
8+
#'

man/MCMC-combos.Rd

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

man/MCMC-diagnostics.Rd

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

man/MCMC-distributions.Rd

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

man/MCMC-intervals.Rd

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

0 commit comments

Comments
 (0)