Skip to content

Commit 67b863c

Browse files
committed
updating documentation and adding new tests
1 parent 4b695dc commit 67b863c

File tree

6 files changed

+236
-5
lines changed

6 files changed

+236
-5
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* PPC "avg" functions (`ppc_scatter_avg()`, `ppc_error_scatter_avg()`, etc.) gain a `stat` argument to set the averaging function. (Suggestion of #348, @kruschke).
44
* `ppc_error_scatter_avg_vs_x(x = some_expression)` labels the *x* axis with `some_expression`.
55
* Add `ppc_dots()` and `ppd_dots()` by @behramulukir (#357)
6+
* Add `x` argument to `ppc_error_binned` by @behramulukir (#359)
67

78
# bayesplot 1.13.0
89

R/ppc-errors.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#' @template args-y-yrep
1010
#' @template args-group
1111
#' @template args-facet_args
12+
#' @param x A numeric vector the same length as `y` to use as the x-axis variable.
1213
#' @param ... Currently unused.
1314
#' @param stat A function or a string naming a function for computing the
1415
#' posterior average. In both cases, the function should take a vector input and
@@ -109,6 +110,10 @@
109110
#' yrep_prop <- sweep(yrep, 2, trials, "/")
110111
#'
111112
#' ppc_error_binned(y_prop, yrep_prop[1:6, ])
113+
#'
114+
#' # plotting against a covariate on x-axis
115+
#' herd <- as.numeric(example_model$data$herd)
116+
#' ppc_error_binned(y_prop, yrep_prop[1:6, ], x = herd)
112117
#' }
113118
#'
114119
NULL
@@ -270,9 +275,6 @@ ppc_error_scatter_avg_grouped <-
270275

271276
#' @rdname PPC-errors
272277
#' @export
273-
#' @param x A numeric vector the same length as `y` to use as the x-axis
274-
#' variable.
275-
#'
276278
ppc_error_scatter_avg_vs_x <- function(
277279
y,
278280
yrep,

man/PPC-errors.Rd

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

0 commit comments

Comments
 (0)