Skip to content

Commit 2dd1a7a

Browse files
committed
Add documentation for ppc_data and ppc_loo_pit_data
Fixes #209
1 parent 306c92e commit 2dd1a7a

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# bayesplot (development version)
22

3+
* Documentation added for `ppc_data()` and `ppc_loo_pit_data()` functions (#209)
34
* New functions `mcmc_dots` and `mcmc_dots_by_chain` for dot plots of MCMC draws by @behramulukir (#402)
45
* Default to `quantiles=100` for all dot plots by @behramulukir (#402)
56

R/ppc-distributions.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
#'
2323
#' @section Plot Descriptions:
2424
#' \describe{
25+
#' \item{`ppc_data()`}{
26+
#' This function prepares data for plotting with **ggplot2**. It is the
27+
#' data-preparation back end for all the `ppc_*()` plotting functions, and
28+
#' users can call it directly to create custom PPC plots using ggplot2. The
29+
#' function returns a data frame (or list of data frames) that can be used to
30+
#' build ggplot objects. This is useful when you want to customize the
31+
#' appearance of PPC plots beyond what the built-in plotting functions allow,
32+
#' or when you want to create entirely new types of PPC visualizations.
33+
#' }
2534
#' \item{`ppc_hist(), ppc_freqpoly(), ppc_dens(), ppc_boxplot()`}{
2635
#' A separate histogram, shaded frequency polygon, smoothed kernel density
2736
#' estimate, or box and whiskers plot is displayed for `y` and each

R/ppc-loo.R

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@
2323
#' `ppc_loo_ribbon()`, `alpha` and `size` are passed to
2424
#' [ggplot2::geom_ribbon()].
2525
#'
26-
#' @template return-ggplot
26+
#' @template return-ggplot-or-data
2727
#'
2828
#' @section Plot Descriptions:
2929
#' \describe{
30+
#' \item{`ppc_loo_pit_data()`}{
31+
#' This function prepares LOO-PIT data for plotting with **ggplot2**. It is
32+
#' the data-preparation back end for the LOO-PIT plotting functions
33+
#' (`ppc_loo_pit_overlay()`, `ppc_loo_pit_qq()`, and `ppc_loo_pit_ecdf()`),
34+
#' and users can call it directly to create custom LOO-PIT plots using
35+
#' ggplot2. The function computes the leave-one-out probability integral
36+
#' transform (LOO-PIT) values and returns a data frame that can be used to
37+
#' build ggplot objects. This is useful when you want to create custom
38+
#' visualizations of LOO-PIT values beyond what the built-in plotting
39+
#' functions provide.
40+
#' }
3041
#' \item{`ppc_loo_pit_overlay()`, `ppc_loo_pit_qq()`, `ppc_loo_pit_ecdf()`}{
3142
#' The calibration of marginal predictions can be assessed using probability
3243
#' integral transformation (PIT) checks. LOO improves the check by avoiding the

man/PPC-distributions.Rd

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

man/PPC-loo.Rd

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)