From b98d6262c9f45cffff0189586bf772aaf9deef37 Mon Sep 17 00:00:00 2001 From: ishaan-arora-1 Date: Tue, 10 Mar 2026 02:16:52 +0530 Subject: [PATCH 1/4] Deprecate user-facing `size` and `fatten` args for ggplot2 4.0 (#408) Complete the remaining tasks from #408: - Deprecate `size` in favor of `linewidth` for all plotting functions where `size` controlled line width (density overlays, ribbons, ECDFs, boxplots, violins, error binned, parcoord, acf, KM overlays) - Deprecate `fatten` in `ppc_intervals()`, `ppd_intervals()`, `ppc_loo_intervals()`, `ppc_bars()`, and grouped variants using `lifecycle::deprecated()`. Point size is now controlled directly by `size`, matching ggplot2 4.0 semantics where `fatten` was removed from `geom_pointrange()` - Change default `size` from 1 to 2.5 in interval/bar plots to preserve visual appearance (old `size * fatten = 1 * 2.5`) - Add `lifecycle` as an imported dependency - Update roxygen documentation and examples --- DESCRIPTION | 1 + NAMESPACE | 3 ++ NEWS.md | 9 ++++++ R/bayesplot-package.R | 1 + R/helpers-shared.R | 46 +++++++++++++++++++++++++++++ R/mcmc-diagnostics.R | 12 ++++---- R/mcmc-parcoord.R | 6 ++-- R/ppc-censoring.R | 10 +++++-- R/ppc-discrete.R | 29 ++++++++++--------- R/ppc-distributions.R | 61 +++++++++++++++++++++++++-------------- R/ppc-errors.R | 8 +++-- R/ppc-intervals.R | 47 +++++++++++++++++------------- R/ppc-loo.R | 44 +++++++++++++++++----------- R/ppd-distributions.R | 44 +++++++++++++++++++--------- R/ppd-intervals.R | 44 +++++++++++++++------------- man/MCMC-diagnostics.Rd | 3 +- man/MCMC-distributions.Rd | 2 +- man/MCMC-parcoord.Rd | 3 +- man/PPC-censoring.Rd | 6 ++-- man/PPC-discrete.Rd | 21 ++++++++------ man/PPC-distributions.Rd | 53 +++++++++++++++++++++++++--------- man/PPC-errors.Rd | 3 +- man/PPC-intervals.Rd | 34 ++++++++++++---------- man/PPC-loo.Rd | 26 ++++++++++------- man/PPD-distributions.Rd | 31 +++++++++++++++----- man/PPD-intervals.Rd | 45 +++++++++++++++-------------- 26 files changed, 391 insertions(+), 201 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9f47b08bc..6b28a1997 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,6 +34,7 @@ Imports: ggplot2 (>= 3.4.0), ggridges (>= 0.5.5), glue, + lifecycle, posterior, reshape2, rlang (>= 0.3.0), diff --git a/NAMESPACE b/NAMESPACE index b8cf818b5..56bfb0454 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -226,3 +226,6 @@ importFrom(dplyr,top_n) importFrom(dplyr,ungroup) importFrom(dplyr,vars) importFrom(ggplot2,"%+replace%") +importFrom(lifecycle,deprecate_warn) +importFrom(lifecycle,deprecated) +importFrom(lifecycle,is_present) diff --git a/NEWS.md b/NEWS.md index b3e8922c8..24ef69029 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,14 @@ # bayesplot (development version) +* Deprecate user-facing `size` arguments that controlled line width in favor of + `linewidth` across all plotting functions. The `size` argument still works but + emits a deprecation warning. (#408) +* Deprecate the `fatten` argument in `ppc_intervals()`, `ppd_intervals()`, + `ppc_loo_intervals()`, `ppc_bars()`, and their grouped variants. Point size in + `geom_pointrange()` is now controlled directly by `size`, matching ggplot2 4.0 + semantics. The default `size` has been changed from 1 to 2.5 to preserve the + previous visual appearance (old `size * fatten`). (#408) +* Added `lifecycle` as an imported dependency for deprecation infrastructure. * Documentation added for all exported `*_data()` functions (#209) * Improved documentation for `binwidth`, `bins`, and `breaks` arguments to clarify they are passed to `ggplot2::geom_area()` and `ggdist::stat_dots()` in addition to `ggplot2::geom_histogram()` * Improved documentation for `freq` argument to clarify it applies to frequency polygons in addition to histograms diff --git a/R/bayesplot-package.R b/R/bayesplot-package.R index 2727a62ac..eb26da380 100644 --- a/R/bayesplot-package.R +++ b/R/bayesplot-package.R @@ -4,6 +4,7 @@ #' @aliases bayesplot #' #' @import ggplot2 stats rlang +#' @importFrom lifecycle deprecated deprecate_warn is_present #' @importFrom dplyr %>% summarise group_by select #' #' @description diff --git a/R/helpers-shared.R b/R/helpers-shared.R index 34890feb3..6a9425a3a 100644 --- a/R/helpers-shared.R +++ b/R/helpers-shared.R @@ -45,6 +45,52 @@ check_ignored_arguments <- function(..., ok_args = character()) { } } +#' Handle size -> linewidth deprecation +#' +#' @param size User's `size` argument (deprecated for lines). +#' @param linewidth User's `linewidth` argument (replacement). +#' @param default_linewidth Default linewidth value if neither is specified. +#' @param calling_fn Name of the calling function for the deprecation message. +#' @return The resolved linewidth value. +#' @noRd +resolve_linewidth <- function(size, linewidth, default_linewidth, calling_fn = NULL) { + if (!is.null(size)) { + lifecycle::deprecate_warn( + when = "1.16.0", + what = paste0(calling_fn %||% "fn", "(size)"), + with = paste0(calling_fn %||% "fn", "(linewidth)") + ) + return(size) + } + linewidth %||% default_linewidth +} + + +#' Handle fatten deprecation +#' +#' @param fatten User's `fatten` argument (deprecated). +#' @param size User's `size` argument. +#' @param default_size Default size when neither `fatten` nor `size` is given. +#' @param calling_fn Name of the calling function for the deprecation message. +#' @return The resolved point `size` value. +#' @noRd +resolve_fatten <- function(fatten, size, default_size, calling_fn = NULL) { + if (!lifecycle::is_present(fatten)) { + return(size %||% default_size) + } + + lifecycle::deprecate_warn( + when = "1.16.0", + what = paste0(calling_fn %||% "fn", "(fatten)"), + details = paste0( + "The point size is now controlled directly by `size`. ", + "The `fatten` argument will be removed in a future release." + ) + ) + size %||% default_size +} + + #' Validate bounds passed to stat_density/geom_density wrappers #' @noRd validate_density_bounds <- function(bounds) { diff --git a/R/mcmc-diagnostics.R b/R/mcmc-diagnostics.R index 2727928f2..2640c0f9b 100644 --- a/R/mcmc-diagnostics.R +++ b/R/mcmc-diagnostics.R @@ -322,15 +322,17 @@ mcmc_acf <- ..., facet_args = list(), lags = 20, - size = NULL) { + size = NULL, + linewidth = NULL) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = NULL, calling_fn = "mcmc_acf") .mcmc_acf( x, pars = pars, regex_pars = regex_pars, facet_args = facet_args, lags = lags, - size = size, + linewidth = linewidth, style = "line" ) } @@ -514,7 +516,7 @@ drop_NAs_and_warn <- function(x) { } # Autocorrelation plot (either bar or line) -# @param size passed to geom_line() if style="line" +# @param linewidth passed to geom_line() if style="line" .mcmc_acf <- function(x, pars = character(), @@ -522,7 +524,7 @@ drop_NAs_and_warn <- function(x) { facet_args = list(), lags = 25, style = c("bar", "line"), - size = NULL) { + linewidth = NULL) { style <- match.arg(style) x <- prepare_mcmc_array(x, pars, regex_pars) @@ -561,7 +563,7 @@ drop_NAs_and_warn <- function(x) { ) + do.call( "geom_line", - args = c(list(color = get_color("d")), linewidth = size) + args = c(list(color = get_color("d")), linewidth = linewidth) ) } diff --git a/R/mcmc-parcoord.R b/R/mcmc-parcoord.R index 6891ed466..0f0a2d7a6 100644 --- a/R/mcmc-parcoord.R +++ b/R/mcmc-parcoord.R @@ -114,11 +114,13 @@ mcmc_parcoord <- regex_pars = character(), transformations = list(), ..., - size = 0.2, + size = NULL, + linewidth = 0.2, alpha = 0.3, np = NULL, np_style = parcoord_style_np()) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.2, calling_fn = "mcmc_parcoord") stopifnot(inherits(np_style, "nuts_style")) data <- @@ -142,7 +144,7 @@ mcmc_parcoord <- group = factor(.data$Draw) )) + geom_line( - linewidth = size, + linewidth = linewidth, alpha = alpha, color = get_color("dh") ) + diff --git a/R/ppc-censoring.R b/R/ppc-censoring.R index e41cbae91..13da8f940 100644 --- a/R/ppc-censoring.R +++ b/R/ppc-censoring.R @@ -103,10 +103,12 @@ ppc_km_overlay <- function( status_y, left_truncation_y = NULL, extrapolation_factor = 1.2, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) { check_ignored_arguments(..., ok_args = "add_group") + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, calling_fn = "ppc_km_overlay") add_group <- list(...)$add_group suggested_package("survival") @@ -172,7 +174,7 @@ ppc_km_overlay <- function( } fsf$is_y_color <- as.factor(sub("\\[rep\\] \\(.*$", "rep", sub("^italic\\(y\\)", "y", fsf$strata))) - fsf$is_y_linewidth <- ifelse(fsf$is_y_color == "yrep", size, 1) + fsf$is_y_linewidth <- ifelse(fsf$is_y_color == "yrep", linewidth, 1) fsf$is_y_alpha <- ifelse(fsf$is_y_color == "yrep", alpha, 1) max_time_y <- max(y, na.rm = TRUE) @@ -225,7 +227,8 @@ ppc_km_overlay_grouped <- function( status_y, left_truncation_y = NULL, extrapolation_factor = 1.2, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) { check_ignored_arguments(...) @@ -238,6 +241,7 @@ ppc_km_overlay_grouped <- function( status_y = status_y, left_truncation_y = left_truncation_y, size = size, + linewidth = linewidth, alpha = alpha, extrapolation_factor = extrapolation_factor ) diff --git a/R/ppc-discrete.R b/R/ppc-discrete.R index 2c3f54a96..96c95d033 100644 --- a/R/ppc-discrete.R +++ b/R/ppc-discrete.R @@ -18,10 +18,12 @@ #' of the expected counts.) #' @param width For bar plots only, passed to [ggplot2::geom_bar()] to control #' the bar width. -#' @param size,fatten,linewidth For bar plots, `size`, `fatten`, and `linewidth` -#' are passed to [ggplot2::geom_pointrange()] to control the appearance of the -#' `yrep` points and intervals. For rootograms `size` is passed to -#' [ggplot2::geom_line()] and [ggplot2::geom_pointrange()]. +#' @param size,linewidth For bar plots, `size` and `linewidth` are passed to +#' [ggplot2::geom_pointrange()] to control the appearance of the `yrep` points +#' and intervals, where `size` controls the point size and `linewidth` controls +#' the line width. For rootograms `size` is passed to [ggplot2::geom_point()] +#' and [ggplot2::geom_pointrange()]. +#' @param fatten Deprecated. Point size is now controlled directly by `size`. #' @param freq For bar plots only, if `TRUE` (the default) the y-axis will #' display counts. Setting `freq=FALSE` will put proportions on the y-axis. #' @param bound_distinct For `ppc_rootogram(style = "discrete)`, @@ -147,7 +149,6 @@ #' group = esoph$agegp, #' freq=FALSE, #' prob = 0.5, -#' fatten = 1, #' size = 1.5 #' ) #' } @@ -162,8 +163,8 @@ ppc_bars <- ..., prob = 0.9, width = 0.9, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1, freq = TRUE) { @@ -172,6 +173,8 @@ ppc_bars <- check_ignored_arguments(...) dots$group <- NULL } + size <- resolve_fatten(fatten, size, default_size = 2.5, + calling_fn = "ppc_bars") data <- ppc_bars_data( y = y, @@ -197,7 +200,6 @@ ppc_bars <- geom_pointrange( mapping = intervals_inner_aes(needs_y = TRUE, color = "yrep"), size = size, - fatten = fatten, linewidth = linewidth, na.rm = TRUE ) + @@ -229,8 +231,8 @@ ppc_bars_grouped <- facet_args = list(), prob = 0.9, width = 0.9, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1, freq = TRUE) { check_ignored_arguments(...) @@ -277,6 +279,7 @@ ppc_rootogram <- function(y, ..., prob = 0.9, size = 1, + linewidth = 1, bound_distinct = TRUE) { check_ignored_arguments(...) style <- match.arg(style) @@ -289,7 +292,6 @@ ppc_rootogram <- function(y, bound_distinct = bound_distinct ) - # Building geoms for y and y_rep geom_y <- if (style == "discrete") { geom_point( aes(y = .data$obs, shape = .data$obs_shape), @@ -313,16 +315,15 @@ ppc_rootogram <- function(y, geom_pointrange( aes(y = .data$pred_median, ymin = .data$lower, ymax = .data$upper, color = "y_rep"), fill = get_color("lh"), - linewidth = size, + linewidth = linewidth, size = size, - fatten = 2, alpha = 1 ) } else { geom_smooth( aes(x = .data$xpos, y = .data$tyexp, color = "Expected"), fill = get_color("d"), - linewidth = size, + linewidth = linewidth, stat = "identity" ) } diff --git a/R/ppc-distributions.R b/R/ppc-distributions.R index d32a2e1a7..264c7c084 100644 --- a/R/ppc-distributions.R +++ b/R/ppc-distributions.R @@ -13,8 +13,10 @@ #' @template args-hist-freq #' @template args-dens #' @template args-pit-ecdf -#' @param size,alpha Passed to the appropriate geom to control the appearance of -#' the predictive distributions. +#' @param linewidth,alpha Passed to the appropriate geom to control the +#' appearance of the predictive distributions. For overlay and density-type +#' plots, `linewidth` controls the line width. +#' @param size Deprecated for line-width control. Use `linewidth` instead. #' @param ... For dot plots, optional additional arguments to pass to [ggdist::stat_dots()]. #' #' @template details-binomial @@ -111,7 +113,7 @@ #' #' \donttest{ #' # frequency polygons -#' ppc_freqpoly(y, yrep[1:3, ], alpha = 0.1, size = 1, binwidth = 5) +#' ppc_freqpoly(y, yrep[1:3, ], alpha = 0.1, linewidth = 1, binwidth = 5) #' #' ppc_freqpoly_grouped(y, yrep[1:3, ], group) + yaxis_text() #' @@ -134,7 +136,7 @@ #' # don't need to only use small number of rows for ppc_violin_grouped #' # (as it pools yrep draws within groups) #' color_scheme_set("gray") -#' ppc_violin_grouped(y, yrep, group, size = 1.5) +#' ppc_violin_grouped(y, yrep, group, linewidth = 1.5) #' ppc_violin_grouped(y, yrep, group, alpha = 0) #' #' # change how y is drawn @@ -168,7 +170,8 @@ ppc_dens_overlay <- function(y, yrep, ..., - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, trim = FALSE, bw = "nrd0", @@ -177,6 +180,7 @@ ppc_dens_overlay <- bounds = NULL, n_dens = 1024) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, calling_fn = "ppc_dens_overlay") bounds <- validate_density_bounds(bounds) data <- ppc_data(y, yrep) @@ -184,7 +188,7 @@ ppc_dens_overlay <- overlay_ppd_densities( mapping = aes(group = .data$rep_id, color = "yrep"), data = function(x) dplyr::filter(x, !.data$is_y), - linewidth = size, + linewidth = linewidth, alpha = alpha, trim = trim, bw = bw, @@ -222,7 +226,8 @@ ppc_dens_overlay_grouped <- function(y, yrep, group, ..., - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, trim = FALSE, bw = "nrd0", @@ -231,12 +236,13 @@ ppc_dens_overlay_grouped <- function(y, bounds = NULL, n_dens = 1024) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, calling_fn = "ppc_dens_overlay_grouped") p_overlay <- ppc_dens_overlay( y = y, yrep = yrep, ..., - size = size, + linewidth = linewidth, alpha = alpha, trim = trim, bw = bw, @@ -269,9 +275,11 @@ ppc_ecdf_overlay <- function(y, ..., discrete = FALSE, pad = TRUE, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, calling_fn = "ppc_ecdf_overlay") data <- ppc_data(y, yrep) ggplot(data) + @@ -292,7 +300,7 @@ ppc_ecdf_overlay <- function(y, data = function(x) dplyr::filter(x, !.data$is_y), mapping = aes(group = .data$rep_id, color = "yrep"), geom = if (discrete) "step" else "line", - linewidth = size, + linewidth = linewidth, alpha = alpha, pad = pad ) + @@ -318,9 +326,11 @@ ppc_ecdf_overlay_grouped <- function(y, ..., discrete = FALSE, pad = TRUE, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, calling_fn = "ppc_ecdf_overlay_grouped") p_overlay <- ppc_ecdf_overlay( y = y, @@ -328,7 +338,7 @@ ppc_ecdf_overlay_grouped <- function(y, ..., discrete = discrete, pad = pad, - size = size, + linewidth = linewidth, alpha = alpha ) @@ -349,10 +359,12 @@ ppc_dens <- yrep, ..., trim = FALSE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1, bounds = NULL) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, calling_fn = "ppc_dens") bounds <- validate_density_bounds(bounds) data <- ppc_data(y, yrep) ggplot(data, mapping = aes( @@ -361,7 +373,7 @@ ppc_dens <- color = .data$is_y_label )) + geom_density( - linewidth = size, + linewidth = linewidth, alpha = alpha, trim = trim, bounds = bounds @@ -431,13 +443,15 @@ ppc_freqpoly <- binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1) { dots <- list(...) if (!from_grouped(dots)) { check_ignored_arguments(...) dots$group <- NULL } + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, calling_fn = "ppc_freqpoly") data <- ppc_data(y, yrep, group = dots$group) ggplot(data, mapping = set_hist_aes( @@ -449,7 +463,7 @@ ppc_freqpoly <- stat = "bin", binwidth = binwidth, bins = bins, - linewidth = size, + linewidth = linewidth, alpha = alpha ) + scale_fill_ppc() + @@ -477,7 +491,8 @@ ppc_freqpoly_grouped <- binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1) { check_ignored_arguments(...) call <- match.call(expand.dots = FALSE) @@ -505,9 +520,11 @@ ppc_boxplot <- yrep, ..., notch = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, calling_fn = "ppc_boxplot") data <- ppc_data(y, yrep) ggplot(data, mapping = aes( @@ -518,7 +535,7 @@ ppc_boxplot <- )) + geom_boxplot( notch = notch, - linewidth = size, + linewidth = linewidth, alpha = alpha, outlier.alpha = 2 / 3, outlier.size = 1 @@ -591,13 +608,15 @@ ppc_violin_grouped <- group, ..., probs = c(0.1, 0.5, 0.9), - size = 1, + size = NULL, + linewidth = 1, alpha = 1, y_draw = c("violin", "points", "both"), y_size = 1, y_alpha = 1, y_jitter = 0.1) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 1, calling_fn = "ppc_violin_grouped") y_draw <- match.arg(y_draw) y_violin <- y_draw %in% c("violin", "both") @@ -608,7 +627,7 @@ ppc_violin_grouped <- aes(fill = "yrep", color = "yrep"), draw_quantiles = probs, alpha = alpha, - linewidth = size + linewidth = linewidth ) if (utils::packageVersion("ggplot2") >= "4.0.0") { args_violin_yrep$draw_quantiles <- NULL diff --git a/R/ppc-errors.R b/R/ppc-errors.R index f0012f244..e94ec1e1d 100644 --- a/R/ppc-errors.R +++ b/R/ppc-errors.R @@ -341,9 +341,11 @@ ppc_error_binned <- ..., facet_args = list(), bins = NULL, - size = 1, + size = NULL, + linewidth = 1, alpha = 0.25) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 1, calling_fn = "ppc_error_binned") qx <- enquo(x) data <- ppc_error_binnned_data(y, yrep, x = x, bins = bins) @@ -369,12 +371,12 @@ ppc_error_binned <- geom_path( mapping = aes(y = .data$se2), color = get_color("l"), - linewidth = size + linewidth = linewidth ) + geom_path( mapping = aes(y = -.data$se2), color = get_color("l"), - linewidth = size + linewidth = linewidth ) + geom_point( mapping = aes(y = .data$err_bar), diff --git a/R/ppc-intervals.R b/R/ppc-intervals.R index b41be3b05..5d7ef77b1 100644 --- a/R/ppc-intervals.R +++ b/R/ppc-intervals.R @@ -16,13 +16,14 @@ #' variable. For example, `x` could be a predictor variable from a #' regression model, a time variable for time-series models, etc. If `x` #' is missing or `NULL` then the observation index is used for the x-axis. -#' @param alpha,size,fatten,linewidth Arguments passed to geoms. For ribbon -#' plots `alpha` is passed to [ggplot2::geom_ribbon()] to control the opacity -#' of the outer ribbon and `size` is passed to [ggplot2::geom_line()] to -#' control the size of the line representing the median prediction (`size=0` -#' will remove the line). For interval plots `alpha`, `size`, `fatten`, and -#' `linewidth` are passed to [ggplot2::geom_pointrange()] (`fatten=0` will -#' remove the point estimates). +#' @param alpha,size,linewidth Arguments passed to geoms. For ribbon plots +#' `alpha` is passed to [ggplot2::geom_ribbon()] to control the opacity of the +#' outer ribbon and `linewidth` is passed to [ggplot2::geom_line()] to control +#' the width of the line representing the median prediction (`linewidth=0` +#' will remove the line). For interval plots `alpha`, `size`, and `linewidth` +#' are passed to [ggplot2::geom_pointrange()] where `size` controls the point +#' size and `linewidth` controls the line width. +#' @param fatten Deprecated. Point size is now controlled directly by `size`. #' @param ... Currently unused. #' #' @template return-ggplot-or-data @@ -71,11 +72,11 @@ #' ppc_ribbon(y, yrep, y_draw = "both") #' } #' -#' ppc_intervals(y, yrep, size = 1.5, fatten = 0) # remove the yrep point estimates +#' ppc_intervals(y, yrep, size = 0) # remove the yrep point estimates #' #' color_scheme_set("teal") #' year <- 1950:1999 -#' ppc_intervals(y, yrep, x = year, fatten = 1) + ggplot2::xlab("Year") +#' ppc_intervals(y, yrep, x = year, size = 1) + ggplot2::xlab("Year") #' ppc_ribbon(y, yrep, x = year) + ggplot2::xlab("Year") #' #' color_scheme_set("pink") @@ -135,8 +136,8 @@ ppc_intervals <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1) { dots <- list(...) @@ -144,6 +145,8 @@ ppc_intervals <- check_ignored_arguments(...) dots$group <- NULL } + size <- resolve_fatten(fatten, size, default_size = 2.5, + calling_fn = "ppc_intervals") data <- ppc_intervals_data( @@ -170,7 +173,6 @@ ppc_intervals <- shape = 21, stroke = 0.5, size = size, - fatten = fatten, linewidth = linewidth ) + geom_point( @@ -202,8 +204,8 @@ ppc_intervals_grouped <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1) { check_ignored_arguments(...) call <- match.call(expand.dots = FALSE) @@ -226,10 +228,14 @@ ppc_ribbon <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25, + size = NULL, + linewidth = 0.25, y_draw = c("line", "points", "both")) { y_draw <- match.arg(y_draw) + linewidth <- resolve_linewidth(size, linewidth, + default_linewidth = 0.25, + calling_fn = "ppc_ribbon") dots <- list(...) if (!from_grouped(dots)) { check_ignored_arguments(...) @@ -251,21 +257,21 @@ ppc_ribbon <- geom_ribbon( mapping = intervals_outer_aes(fill = "yrep", color = "yrep"), color = NA, - linewidth = 0.2 * size, + linewidth = 0.2 * linewidth, alpha = alpha ) + geom_ribbon( mapping = intervals_outer_aes(), fill = NA, color = get_color("m"), - linewidth = 0.2 * size, + linewidth = 0.2 * linewidth, alpha = 1 ) + - geom_ribbon(linewidth = 0.5 * size) + + geom_ribbon(linewidth = 0.5 * linewidth) + geom_line( mapping = aes(y = .data$m), color = get_color("m"), - linewidth = size + linewidth = linewidth ) + geom_blank(aes(fill = "y")) @@ -303,7 +309,8 @@ ppc_ribbon_grouped <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25, + size = NULL, + linewidth = 0.25, y_draw = c("line", "points", "both")) { check_ignored_arguments(...) call <- match.call(expand.dots = FALSE) diff --git a/R/ppc-loo.R b/R/ppc-loo.R index e0f930390..f3f8d2a76 100644 --- a/R/ppc-loo.R +++ b/R/ppc-loo.R @@ -15,13 +15,14 @@ #' @param psis_object If using **loo** version `2.0.0` or greater, an #' object returned by the `psis()` function (or by the `loo()` function #' with argument `save_psis` set to `TRUE`). -#' @param alpha,size,fatten,linewidth Arguments passed to code geoms to control -#' plot aesthetics. For `ppc_loo_pit_qq()` and `ppc_loo_pit_overlay()`,`size` -#' and `alpha` are passed to [ggplot2::geom_point()] and -#' [ggplot2::geom_density()], respectively. For `ppc_loo_intervals()`, `size` -#' `linewidth` and `fatten` are passed to [ggplot2::geom_pointrange()]. For -#' `ppc_loo_ribbon()`, `alpha` and `size` are passed to -#' [ggplot2::geom_ribbon()]. +#' @param alpha,size,linewidth Arguments passed to geoms to control plot +#' aesthetics. For `ppc_loo_pit_qq()`, `size` and `alpha` are passed to +#' [ggplot2::geom_point()]. For `ppc_loo_pit_overlay()`, `linewidth` and +#' `alpha` control the line width and opacity. For `ppc_loo_intervals()`, +#' `size` controls the point size and `linewidth` controls the line width +#' in [ggplot2::geom_pointrange()]. For `ppc_loo_ribbon()`, `alpha` and +#' `linewidth` control the ribbon opacity and median line width. +#' @param fatten Deprecated. Point size is now controlled directly by `size`. #' #' @template return-ggplot-or-data #' @@ -177,7 +178,8 @@ ppc_loo_pit_overlay <- function(y, psis_object = NULL, pit = NULL, samples = 100, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, boundary_correction = TRUE, grid_len = 512, @@ -187,6 +189,9 @@ ppc_loo_pit_overlay <- function(y, kernel = "gaussian", n_dens = 1024) { check_ignored_arguments(..., ok_args = list("moment_match")) + linewidth <- resolve_linewidth(size, linewidth, + default_linewidth = 0.25, + calling_fn = "ppc_loo_pit_overlay") data <- ppc_loo_pit_data( @@ -222,7 +227,7 @@ ppc_loo_pit_overlay <- function(y, aes(group = .data$rep_id, color = "yrep"), data = function(x) dplyr::filter(x, !.data$is_y), alpha = alpha, - linewidth = size, + linewidth = linewidth, na.rm = TRUE ) + geom_line( @@ -246,7 +251,7 @@ ppc_loo_pit_overlay <- function(y, data = function(x) dplyr::filter(x, !.data$is_y), geom = "line", position = "identity", - linewidth = size, + linewidth = linewidth, alpha = alpha, trim = trim, bw = bw, @@ -542,11 +547,13 @@ ppc_loo_intervals <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1, order = c("index", "median")) { check_ignored_arguments(..., ok_args = list("moment_match")) + size <- resolve_fatten(fatten, size, default_size = 2.5, + calling_fn = "ppc_loo_intervals") y <- validate_y(y) order_by_median <- match.arg(order) == "median" if (!is.null(intervals)) { @@ -598,14 +605,13 @@ ppc_loo_intervals <- geom_linerange( mapping = intervals_outer_aes(color = "yrep"), alpha = alpha, - linewidth = size + linewidth = linewidth ) + geom_pointrange( shape = 21, stroke = 0.5, linewidth = linewidth, - size = size, - fatten = fatten + size = size ) + geom_point( mapping = aes( @@ -637,8 +643,12 @@ ppc_loo_ribbon <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25) { + size = NULL, + linewidth = 0.25) { check_ignored_arguments(..., ok_args = list("moment_match")) + linewidth <- resolve_linewidth(size, linewidth, + default_linewidth = 0.25, + calling_fn = "ppc_loo_ribbon") y <- validate_y(y) if (!is.null(intervals)) { stopifnot(is.matrix(intervals), ncol(intervals) %in% c(3, 5)) @@ -688,7 +698,7 @@ ppc_loo_ribbon <- geom_line( mapping = aes(y = .data$m), color = get_color("m"), - linewidth = size + linewidth = linewidth ) + geom_blank(aes(fill = "y")) + geom_line( diff --git a/R/ppd-distributions.R b/R/ppd-distributions.R index 70c4e5a68..da6f07527 100644 --- a/R/ppd-distributions.R +++ b/R/ppd-distributions.R @@ -39,7 +39,8 @@ ppd_data <- function(ypred, group = NULL) { ppd_dens_overlay <- function(ypred, ..., - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, trim = FALSE, bw = "nrd0", @@ -48,13 +49,15 @@ ppd_dens_overlay <- bounds = NULL, n_dens = 1024) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, + calling_fn = "ppd_dens_overlay") bounds <- validate_density_bounds(bounds) data <- ppd_data(ypred) ggplot(data, mapping = aes(x = .data$value)) + overlay_ppd_densities( mapping = aes(group = .data$rep_id, color = "ypred"), - linewidth = size, + linewidth = linewidth, alpha = alpha, trim = trim, bw = bw, @@ -66,7 +69,7 @@ ppd_dens_overlay <- scale_color_ppd( values = get_color("m"), guide = guide_legend( # in case user turns legend back on - override.aes = list(size = 2 * size, alpha = 1)) + override.aes = list(linewidth = 2 * linewidth, alpha = 1)) ) + bayesplot_theme_get() + dont_expand_axes() + @@ -85,9 +88,12 @@ ppd_ecdf_overlay <- ..., discrete = FALSE, pad = TRUE, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.25, + calling_fn = "ppd_ecdf_overlay") data <- ppd_data(ypred) ggplot(data, mapping = aes(x = .data$value)) + @@ -100,14 +106,14 @@ ppd_ecdf_overlay <- stat_ecdf( mapping = aes(group = .data$rep_id, color = "ypred"), geom = if (discrete) "step" else "line", - linewidth = size, + linewidth = linewidth, alpha = alpha, pad = pad ) + scale_color_ppd( values = get_color("m"), guide = guide_legend( # in case user turns legend back on - override.aes = list(linewidth = 2 * size, alpha = 1)) + override.aes = list(linewidth = 2 * linewidth, alpha = 1)) ) + scale_y_continuous(breaks = c(0, 0.5, 1)) + bayesplot_theme_get() + @@ -123,10 +129,13 @@ ppd_dens <- function(ypred, ..., trim = FALSE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1, bounds = NULL) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, + calling_fn = "ppd_dens") bounds <- validate_density_bounds(bounds) data <- ppd_data(ypred) @@ -136,7 +145,7 @@ ppd_dens <- fill = "ypred" )) + geom_density( - linewidth = size, + linewidth = linewidth, alpha = alpha, trim = trim, bounds = bounds @@ -239,7 +248,8 @@ ppd_freqpoly <- binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1) { dots <- list(...) @@ -247,6 +257,8 @@ ppd_freqpoly <- check_ignored_arguments(...) dots$group <- NULL } + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, + calling_fn = "ppd_freqpoly") data <- ppd_data(ypred, group = dots$group) ggplot(data, mapping = set_hist_aes( @@ -258,7 +270,7 @@ ppd_freqpoly <- stat = "bin", binwidth = binwidth, bins = bins, - linewidth = size, + linewidth = linewidth, alpha = alpha ) + facet_wrap_parsed("rep_label") + @@ -285,10 +297,13 @@ ppd_freqpoly_grouped <- binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, + calling_fn = "ppd_freqpoly_grouped") call <- match.call(expand.dots = FALSE) g <- eval(ungroup_call("ppd_freqpoly", call), parent.frame()) g + @@ -309,9 +324,12 @@ ppd_boxplot <- function(ypred, ..., notch = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1) { check_ignored_arguments(...) + linewidth <- resolve_linewidth(size, linewidth, default_linewidth = 0.5, + calling_fn = "ppd_boxplot") data <- ppd_data(ypred) ggplot(data, mapping = aes( @@ -322,7 +340,7 @@ ppd_boxplot <- )) + geom_boxplot( notch = notch, - linewidth = size, + linewidth = linewidth, alpha = alpha, outlier.color = get_color("lh"), outlier.alpha = 2/3, diff --git a/R/ppd-intervals.R b/R/ppd-intervals.R index 631840729..76f050543 100644 --- a/R/ppd-intervals.R +++ b/R/ppd-intervals.R @@ -23,12 +23,12 @@ #' group <- example_group_data() #' #' ppd_intervals(ypred[, 1:50]) -#' ppd_intervals(ypred[, 1:50], fatten = 0) -#' ppd_intervals(ypred[, 1:50], fatten = 0, linewidth = 2) -#' ppd_intervals(ypred[, 1:50], prob_outer = 0.75, fatten = 0, linewidth = 2) +#' ppd_intervals(ypred[, 1:50], size = 0) +#' ppd_intervals(ypred[, 1:50], size = 0, linewidth = 2) +#' ppd_intervals(ypred[, 1:50], prob_outer = 0.75, size = 0, linewidth = 2) #' #' # put a predictor variable on the x-axis -#' ppd_intervals(ypred[, 1:100], x = x[1:100], fatten = 1) + +#' ppd_intervals(ypred[, 1:100], x = x[1:100], size = 1) + #' ggplot2::labs(y = "Prediction", x = "Some variable of interest") #' #' # with a grouping variable too @@ -36,16 +36,15 @@ #' ypred = ypred[, 1:100], #' x = x[1:100], #' group = group[1:100], -#' size = 2, -#' fatten = 0, +#' size = 0, #' facet_args = list(nrow = 2) #' ) #' #' # even reducing size, ppd_intervals is too cluttered when there are many #' # observations included (ppd_ribbon is better) -#' ppd_intervals(ypred, size = 0.5, fatten = 0.1, linewidth = 0.5) +#' ppd_intervals(ypred, size = 0.1, linewidth = 0.5) #' ppd_ribbon(ypred) -#' ppd_ribbon(ypred, size = 0) # remove line showing median prediction +#' ppd_ribbon(ypred, linewidth = 0) # remove line showing median prediction #' NULL @@ -58,8 +57,8 @@ ppd_intervals <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1) { dots <- list(...) @@ -67,7 +66,8 @@ ppd_intervals <- check_ignored_arguments(...) dots$group <- NULL } - + size <- resolve_fatten(fatten, size, default_size = 2.5, + calling_fn = "ppd_intervals") data <- ppd_intervals_data( ypred = ypred, @@ -90,7 +90,6 @@ ppd_intervals <- shape = 21, stroke = 0.5, size = size, - fatten = fatten, linewidth = linewidth ) + scale_color_ppd() + @@ -112,8 +111,8 @@ ppd_intervals_grouped <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1) { check_ignored_arguments(...) call <- match.call(expand.dots = FALSE) @@ -133,8 +132,12 @@ ppd_ribbon <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25) { + size = NULL, + linewidth = 0.25) { + linewidth <- resolve_linewidth(size, linewidth, + default_linewidth = 0.25, + calling_fn = "ppd_ribbon") dots <- list(...) if (!from_grouped(dots)) { check_ignored_arguments(...) @@ -152,21 +155,21 @@ ppd_ribbon <- geom_ribbon( mapping = intervals_outer_aes(fill = "ypred", color = "ypred"), color = NA, - linewidth = 0.2 * size, + linewidth = 0.2 * linewidth, alpha = alpha ) + geom_ribbon( mapping = intervals_outer_aes(), fill = NA, color = get_color("mh"), - linewidth = 0.2 * size, + linewidth = 0.2 * linewidth, alpha = 1 ) + - geom_ribbon(linewidth = 0.5 * size) + + geom_ribbon(linewidth = 0.5 * linewidth) + geom_line( mapping = aes(y = .data$m), color = get_color("d"), - linewidth = size + linewidth = linewidth ) + scale_color_ppd() + scale_fill_ppd() + @@ -187,7 +190,8 @@ ppd_ribbon_grouped <- prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25) { + size = NULL, + linewidth = 0.25) { check_ignored_arguments(...) call <- match.call(expand.dots = FALSE) g <- eval(ungroup_call("ppd_ribbon", call), parent.frame()) diff --git a/man/MCMC-diagnostics.Rd b/man/MCMC-diagnostics.Rd index 35e589dcb..d5f3ed4dc 100644 --- a/man/MCMC-diagnostics.Rd +++ b/man/MCMC-diagnostics.Rd @@ -31,7 +31,8 @@ mcmc_acf( ..., facet_args = list(), lags = 20, - size = NULL + size = NULL, + linewidth = NULL ) mcmc_acf_bar( diff --git a/man/MCMC-distributions.Rd b/man/MCMC-distributions.Rd index 71be98d79..1c12fa2ac 100644 --- a/man/MCMC-distributions.Rd +++ b/man/MCMC-distributions.Rd @@ -180,7 +180,7 @@ parameter is transformed (e.g. \code{"t(sigma)"}). Note: due to partial argument matching \code{transformations} can be abbreviated for convenience in interactive use (e.g., \code{transform}).} -\item{...}{For dot plots, optional additional arguments to pass to \code{\link[ggdist:stat_dots]{ggdist::stat_dots()}}.} +\item{...}{For dot plots, optional additional arguments to pass to [ggdist::stat_dots()].} \item{facet_args}{A named list of arguments (other than \code{facets}) passed to \code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}} or \code{\link[ggplot2:facet_grid]{ggplot2::facet_grid()}} diff --git a/man/MCMC-parcoord.Rd b/man/MCMC-parcoord.Rd index cbb7d2942..a2aa092c3 100644 --- a/man/MCMC-parcoord.Rd +++ b/man/MCMC-parcoord.Rd @@ -13,7 +13,8 @@ mcmc_parcoord( regex_pars = character(), transformations = list(), ..., - size = 0.2, + size = NULL, + linewidth = 0.2, alpha = 0.3, np = NULL, np_style = parcoord_style_np() diff --git a/man/PPC-censoring.Rd b/man/PPC-censoring.Rd index ddf011b42..b8d3901c3 100644 --- a/man/PPC-censoring.Rd +++ b/man/PPC-censoring.Rd @@ -13,7 +13,8 @@ ppc_km_overlay( status_y, left_truncation_y = NULL, extrapolation_factor = 1.2, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) @@ -25,7 +26,8 @@ ppc_km_overlay_grouped( status_y, left_truncation_y = NULL, extrapolation_factor = 1.2, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) } diff --git a/man/PPC-discrete.Rd b/man/PPC-discrete.Rd index 9da2fa17f..be00d9b2e 100644 --- a/man/PPC-discrete.Rd +++ b/man/PPC-discrete.Rd @@ -14,8 +14,8 @@ ppc_bars( ..., prob = 0.9, width = 0.9, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1, freq = TRUE ) @@ -28,8 +28,8 @@ ppc_bars_grouped( facet_args = list(), prob = 0.9, width = 0.9, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1, freq = TRUE ) @@ -41,6 +41,7 @@ ppc_rootogram( ..., prob = 0.9, size = 1, + linewidth = 1, bound_distinct = TRUE ) @@ -67,10 +68,13 @@ of the expected counts.)} \item{width}{For bar plots only, passed to \code{\link[ggplot2:geom_bar]{ggplot2::geom_bar()}} to control the bar width.} -\item{size, fatten, linewidth}{For bar plots, \code{size}, \code{fatten}, and \code{linewidth} -are passed to \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}} to control the appearance of the -\code{yrep} points and intervals. For rootograms \code{size} is passed to -\code{\link[ggplot2:geom_path]{ggplot2::geom_line()}} and \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}}.} +\item{size, linewidth}{For bar plots, \code{size} and \code{linewidth} are passed to +\code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}} to control the appearance of the \code{yrep} points +and intervals, where \code{size} controls the point size and \code{linewidth} controls +the line width. For rootograms \code{size} is passed to \code{\link[ggplot2:geom_point]{ggplot2::geom_point()}} +and \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}}.} + +\item{fatten}{Deprecated. Point size is now controlled directly by \code{size}.} \item{freq}{For bar plots only, if \code{TRUE} (the default) the y-axis will display counts. Setting \code{freq=FALSE} will put proportions on the y-axis.} @@ -232,7 +236,6 @@ ppc_bars_grouped( group = esoph$agegp, freq=FALSE, prob = 0.5, - fatten = 1, size = 1.5 ) } diff --git a/man/PPC-distributions.Rd b/man/PPC-distributions.Rd index b0099f2d1..8fd7c7879 100644 --- a/man/PPC-distributions.Rd +++ b/man/PPC-distributions.Rd @@ -24,7 +24,8 @@ ppc_dens_overlay( y, yrep, ..., - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, trim = FALSE, bw = "nrd0", @@ -39,7 +40,8 @@ ppc_dens_overlay_grouped( yrep, group, ..., - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, trim = FALSE, bw = "nrd0", @@ -55,7 +57,8 @@ ppc_ecdf_overlay( ..., discrete = FALSE, pad = TRUE, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) @@ -66,11 +69,21 @@ ppc_ecdf_overlay_grouped( ..., discrete = FALSE, pad = TRUE, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) -ppc_dens(y, yrep, ..., trim = FALSE, size = 0.5, alpha = 1, bounds = NULL) +ppc_dens( + y, + yrep, + ..., + trim = FALSE, + size = NULL, + linewidth = 0.5, + alpha = 1, + bounds = NULL +) ppc_hist( y, @@ -89,7 +102,8 @@ ppc_freqpoly( binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1 ) @@ -101,11 +115,20 @@ ppc_freqpoly_grouped( binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1 ) -ppc_boxplot(y, yrep, ..., notch = TRUE, size = 0.5, alpha = 1) +ppc_boxplot( + y, + yrep, + ..., + notch = TRUE, + size = NULL, + linewidth = 0.5, + alpha = 1 +) ppc_dots(y, yrep, ..., binwidth = NA, quantiles = 100, freq = TRUE) @@ -115,7 +138,8 @@ ppc_violin_grouped( group, ..., probs = c(0.1, 0.5, 0.9), - size = 1, + size = NULL, + linewidth = 1, alpha = 1, y_draw = c("violin", "points", "both"), y_size = 1, @@ -164,8 +188,11 @@ to the corresponding observation.} \item{...}{For dot plots, optional additional arguments to pass to \code{\link[ggdist:stat_dots]{ggdist::stat_dots()}}.} -\item{size, alpha}{Passed to the appropriate geom to control the appearance of -the predictive distributions.} +\item{size}{Deprecated for line-width control. Use \code{linewidth} instead.} + +\item{linewidth, alpha}{Passed to the appropriate geom to control the +appearance of the predictive distributions. For overlay and density-type +plots, \code{linewidth} controls the line width.} \item{trim}{A logical scalar passed to \code{\link[ggplot2:geom_density]{ggplot2::geom_density()}}.} @@ -349,7 +376,7 @@ ppc_dots(y, yrep[1:8, ]) \donttest{ # frequency polygons -ppc_freqpoly(y, yrep[1:3, ], alpha = 0.1, size = 1, binwidth = 5) +ppc_freqpoly(y, yrep[1:3, ], alpha = 0.1, linewidth = 1, binwidth = 5) ppc_freqpoly_grouped(y, yrep[1:3, ], group) + yaxis_text() @@ -372,7 +399,7 @@ ppc_pit_ecdf_grouped(y, yrep, group=group, prob=0.99) # don't need to only use small number of rows for ppc_violin_grouped # (as it pools yrep draws within groups) color_scheme_set("gray") -ppc_violin_grouped(y, yrep, group, size = 1.5) +ppc_violin_grouped(y, yrep, group, linewidth = 1.5) ppc_violin_grouped(y, yrep, group, alpha = 0) # change how y is drawn diff --git a/man/PPC-errors.Rd b/man/PPC-errors.Rd index e23b29e9c..299809f7f 100644 --- a/man/PPC-errors.Rd +++ b/man/PPC-errors.Rd @@ -75,7 +75,8 @@ ppc_error_binned( ..., facet_args = list(), bins = NULL, - size = 1, + size = NULL, + linewidth = 1, alpha = 0.25 ) diff --git a/man/PPC-intervals.Rd b/man/PPC-intervals.Rd index 6ad715e0f..df14c2533 100644 --- a/man/PPC-intervals.Rd +++ b/man/PPC-intervals.Rd @@ -18,8 +18,8 @@ ppc_intervals( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1 ) @@ -33,8 +33,8 @@ ppc_intervals_grouped( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1 ) @@ -46,7 +46,8 @@ ppc_ribbon( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25, + size = NULL, + linewidth = 0.25, y_draw = c("line", "points", "both") ) @@ -60,7 +61,8 @@ ppc_ribbon_grouped( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25, + size = NULL, + linewidth = 0.25, y_draw = c("line", "points", "both") ) @@ -106,13 +108,15 @@ is missing or \code{NULL} then the observation index is used for the x-axis.} probability mass to include in the inner and outer intervals. The defaults are \code{prob=0.5} and \code{prob_outer=0.9}.} -\item{alpha, size, fatten, linewidth}{Arguments passed to geoms. For ribbon -plots \code{alpha} is passed to \code{\link[ggplot2:geom_ribbon]{ggplot2::geom_ribbon()}} to control the opacity -of the outer ribbon and \code{size} is passed to \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}} to -control the size of the line representing the median prediction (\code{size=0} -will remove the line). For interval plots \code{alpha}, \code{size}, \code{fatten}, and -\code{linewidth} are passed to \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}} (\code{fatten=0} will -remove the point estimates).} +\item{alpha, size, linewidth}{Arguments passed to geoms. For ribbon plots +\code{alpha} is passed to \code{\link[ggplot2:geom_ribbon]{ggplot2::geom_ribbon()}} to control the opacity of the +outer ribbon and \code{linewidth} is passed to \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}} to control +the width of the line representing the median prediction (\code{linewidth=0} +will remove the line). For interval plots \code{alpha}, \code{size}, and \code{linewidth} +are passed to \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}} where \code{size} controls the point +size and \code{linewidth} controls the line width.} + +\item{fatten}{Deprecated. Point size is now controlled directly by \code{size}.} \item{group}{A grouping variable of the same length as \code{y}. Will be coerced to \link[base:factor]{factor} if not already a factor. @@ -180,11 +184,11 @@ ppc_ribbon(y, yrep, y_draw = "points") ppc_ribbon(y, yrep, y_draw = "both") } -ppc_intervals(y, yrep, size = 1.5, fatten = 0) # remove the yrep point estimates +ppc_intervals(y, yrep, size = 0) # remove the yrep point estimates color_scheme_set("teal") year <- 1950:1999 -ppc_intervals(y, yrep, x = year, fatten = 1) + ggplot2::xlab("Year") +ppc_intervals(y, yrep, x = year, size = 1) + ggplot2::xlab("Year") ppc_ribbon(y, yrep, x = year) + ggplot2::xlab("Year") color_scheme_set("pink") diff --git a/man/PPC-loo.Rd b/man/PPC-loo.Rd index 7e9ebe022..8619b4699 100644 --- a/man/PPC-loo.Rd +++ b/man/PPC-loo.Rd @@ -19,7 +19,8 @@ ppc_loo_pit_overlay( psis_object = NULL, pit = NULL, samples = 100, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, boundary_correction = TRUE, grid_len = 512, @@ -89,8 +90,8 @@ ppc_loo_intervals( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1, order = c("index", "median") ) @@ -105,7 +106,8 @@ ppc_loo_ribbon( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25 + size = NULL, + linewidth = 0.25 ) } \arguments{ @@ -142,13 +144,13 @@ distribution. The default is 100. The density estimate of each dataset is plotted as a thin line in the plot, with the density estimate of the LOO PITs overlaid as a thicker dark line.} -\item{alpha, size, fatten, linewidth}{Arguments passed to code geoms to control -plot aesthetics. For \code{ppc_loo_pit_qq()} and \code{ppc_loo_pit_overlay()},\code{size} -and \code{alpha} are passed to \code{\link[ggplot2:geom_point]{ggplot2::geom_point()}} and -\code{\link[ggplot2:geom_density]{ggplot2::geom_density()}}, respectively. For \code{ppc_loo_intervals()}, \code{size} -\code{linewidth} and \code{fatten} are passed to \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}}. For -\code{ppc_loo_ribbon()}, \code{alpha} and \code{size} are passed to -\code{\link[ggplot2:geom_ribbon]{ggplot2::geom_ribbon()}}.} +\item{alpha, size, linewidth}{Arguments passed to geoms to control plot +aesthetics. For \code{ppc_loo_pit_qq()}, \code{size} and \code{alpha} are passed to +\code{\link[ggplot2:geom_point]{ggplot2::geom_point()}}. For \code{ppc_loo_pit_overlay()}, \code{linewidth} and +\code{alpha} control the line width and opacity. For \code{ppc_loo_intervals()}, +\code{size} controls the point size and \code{linewidth} controls the line width +in \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}}. For \code{ppc_loo_ribbon()}, \code{alpha} and +\code{linewidth} control the ribbon opacity and median line width.} \item{boundary_correction}{For \code{ppc_loo_pit_overlay()}, when set to \code{TRUE} (the default) the function will compute boundary corrected density values @@ -217,6 +219,8 @@ data points and five columns in the following order: lower outer interval, lower inner interval, median (50\%), upper inner interval and upper outer interval (column names are ignored).} +\item{fatten}{Deprecated. Point size is now controlled directly by \code{size}.} + \item{order}{For \code{ppc_loo_intervals()}, a string indicating how to arrange the plotted intervals. The default (\code{"index"}) is to plot them in the order of the observations. The alternative (\code{"median"}) arranges them diff --git a/man/PPD-distributions.Rd b/man/PPD-distributions.Rd index a53c62e40..432f680d3 100644 --- a/man/PPD-distributions.Rd +++ b/man/PPD-distributions.Rd @@ -18,7 +18,8 @@ ppd_data(ypred, group = NULL) ppd_dens_overlay( ypred, ..., - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7, trim = FALSE, bw = "nrd0", @@ -33,11 +34,20 @@ ppd_ecdf_overlay( ..., discrete = FALSE, pad = TRUE, - size = 0.25, + size = NULL, + linewidth = 0.25, alpha = 0.7 ) -ppd_dens(ypred, ..., trim = FALSE, size = 0.5, alpha = 1, bounds = NULL) +ppd_dens( + ypred, + ..., + trim = FALSE, + size = NULL, + linewidth = 0.5, + alpha = 1, + bounds = NULL +) ppd_hist(ypred, ..., binwidth = NULL, bins = NULL, breaks = NULL, freq = TRUE) @@ -49,7 +59,8 @@ ppd_freqpoly( binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1 ) @@ -60,11 +71,12 @@ ppd_freqpoly_grouped( binwidth = NULL, bins = NULL, freq = TRUE, - size = 0.5, + size = NULL, + linewidth = 0.5, alpha = 1 ) -ppd_boxplot(ypred, ..., notch = TRUE, size = 0.5, alpha = 1) +ppd_boxplot(ypred, ..., notch = TRUE, size = NULL, linewidth = 0.5, alpha = 1) } \arguments{ \item{ypred}{An \code{S} by \code{N} matrix of draws from the posterior (or prior) @@ -79,8 +91,11 @@ to the corresponding observation.} \item{...}{For dot plots, optional additional arguments to pass to \code{\link[ggdist:stat_dots]{ggdist::stat_dots()}}.} -\item{size, alpha}{Passed to the appropriate geom to control the appearance of -the predictive distributions.} +\item{size}{Deprecated for line-width control. Use \code{linewidth} instead.} + +\item{linewidth, alpha}{Passed to the appropriate geom to control the +appearance of the predictive distributions. For overlay and density-type +plots, \code{linewidth} controls the line width.} \item{trim}{A logical scalar passed to \code{\link[ggplot2:geom_density]{ggplot2::geom_density()}}.} diff --git a/man/PPD-intervals.Rd b/man/PPD-intervals.Rd index 9548709f2..66b2f3b51 100644 --- a/man/PPD-intervals.Rd +++ b/man/PPD-intervals.Rd @@ -17,8 +17,8 @@ ppd_intervals( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1 ) @@ -31,8 +31,8 @@ ppd_intervals_grouped( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 1, - fatten = 2.5, + size = 2.5, + fatten = deprecated(), linewidth = 1 ) @@ -43,7 +43,8 @@ ppd_ribbon( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25 + size = NULL, + linewidth = 0.25 ) ppd_ribbon_grouped( @@ -55,7 +56,8 @@ ppd_ribbon_grouped( prob = 0.5, prob_outer = 0.9, alpha = 0.33, - size = 0.25 + size = NULL, + linewidth = 0.25 ) ppd_intervals_data( @@ -93,13 +95,15 @@ is missing or \code{NULL} then the observation index is used for the x-axis.} probability mass to include in the inner and outer intervals. The defaults are \code{prob=0.5} and \code{prob_outer=0.9}.} -\item{alpha, size, fatten, linewidth}{Arguments passed to geoms. For ribbon -plots \code{alpha} is passed to \code{\link[ggplot2:geom_ribbon]{ggplot2::geom_ribbon()}} to control the opacity -of the outer ribbon and \code{size} is passed to \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}} to -control the size of the line representing the median prediction (\code{size=0} -will remove the line). For interval plots \code{alpha}, \code{size}, \code{fatten}, and -\code{linewidth} are passed to \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}} (\code{fatten=0} will -remove the point estimates).} +\item{alpha, size, linewidth}{Arguments passed to geoms. For ribbon plots +\code{alpha} is passed to \code{\link[ggplot2:geom_ribbon]{ggplot2::geom_ribbon()}} to control the opacity of the +outer ribbon and \code{linewidth} is passed to \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}} to control +the width of the line representing the median prediction (\code{linewidth=0} +will remove the line). For interval plots \code{alpha}, \code{size}, and \code{linewidth} +are passed to \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}} where \code{size} controls the point +size and \code{linewidth} controls the line width.} + +\item{fatten}{Deprecated. Point size is now controlled directly by \code{size}.} \item{group}{A grouping variable of the same length as \code{y}. Will be coerced to \link[base:factor]{factor} if not already a factor. @@ -132,12 +136,12 @@ x <- example_x_data() group <- example_group_data() ppd_intervals(ypred[, 1:50]) -ppd_intervals(ypred[, 1:50], fatten = 0) -ppd_intervals(ypred[, 1:50], fatten = 0, linewidth = 2) -ppd_intervals(ypred[, 1:50], prob_outer = 0.75, fatten = 0, linewidth = 2) +ppd_intervals(ypred[, 1:50], size = 0) +ppd_intervals(ypred[, 1:50], size = 0, linewidth = 2) +ppd_intervals(ypred[, 1:50], prob_outer = 0.75, size = 0, linewidth = 2) # put a predictor variable on the x-axis -ppd_intervals(ypred[, 1:100], x = x[1:100], fatten = 1) + +ppd_intervals(ypred[, 1:100], x = x[1:100], size = 1) + ggplot2::labs(y = "Prediction", x = "Some variable of interest") # with a grouping variable too @@ -145,16 +149,15 @@ ppd_intervals_grouped( ypred = ypred[, 1:100], x = x[1:100], group = group[1:100], - size = 2, - fatten = 0, + size = 0, facet_args = list(nrow = 2) ) # even reducing size, ppd_intervals is too cluttered when there are many # observations included (ppd_ribbon is better) -ppd_intervals(ypred, size = 0.5, fatten = 0.1, linewidth = 0.5) +ppd_intervals(ypred, size = 0.1, linewidth = 0.5) ppd_ribbon(ypred) -ppd_ribbon(ypred, size = 0) # remove line showing median prediction +ppd_ribbon(ypred, linewidth = 0) # remove line showing median prediction } \references{ From ccefd83e23c4c601fe8745615b632f2ceff39b2f Mon Sep 17 00:00:00 2001 From: ishaan-arora-1 Date: Tue, 10 Mar 2026 05:18:49 +0530 Subject: [PATCH 2/4] Fix CI failures: update tests to use linewidth, document linewidth param - Update tests to use `linewidth` instead of deprecated `size` for line-width-controlling functions (ppc_dens_overlay, ppc_ecdf_overlay, ppc_freqpoly, ppc_boxplot, ppc_km_overlay, ppc_ribbon) - Remove `fatten` from test calls (ppc_bars, ppc_intervals) - Add missing `@param linewidth` documentation in MCMC-diagnostics, MCMC-parcoord, PPC-censoring, and PPC-errors - Delete stale vdiffr snapshots so they regenerate on CI --- R/mcmc-diagnostics.R | 5 +- R/mcmc-parcoord.R | 2 +- R/ppc-censoring.R | 4 +- R/ppc-errors.R | 1 + man/MCMC-diagnostics.Rd | 6 +- man/MCMC-distributions.Rd | 2 +- man/MCMC-parcoord.Rd | 2 +- man/PPC-censoring.Rd | 4 +- man/PPC-errors.Rd | 2 + .../ppc-km-overlay-grouped-size-alpha.svg | 133 ---- .../ppc-km-overlay-size-alpha.svg | 73 --- .../_snaps/ppc-discrete/ppc-bars-default.svg | 83 --- .../ppc-discrete/ppc-bars-grouped-default.svg | 147 ----- .../ppc-bars-grouped-facet-args-prob-size.svg | 145 ----- .../ppc-bars-prob-0-33-width-size-fatten.svg | 85 --- .../ppc-bars-width-size-fatten.svg | 83 --- ...ootogram-discrete-bound-distinct-false.svg | 83 --- ...ppc-rootogram-style-discrete-prob-size.svg | 97 --- .../ppc-rootogram-style-hanging-prob-size.svg | 73 --- .../ppc-boxplot-alpha-size.svg | 105 --- .../ppc-dens-overlay-alpha-size.svg | 73 --- .../ppc-dens-overlay-grouped-alpha-size.svg | 234 ------- .../ppc-ecdf-overlay-discrete-size-alpha.svg | 73 --- ...df-overlay-grouped-discrete-size-alpha.svg | 133 ---- .../ppc-freqpoly-alpha-binwidth-size.svg | 185 ------ .../ppd-boxplot-alpha-size.svg | 84 --- .../ppd-dens-overlay-alpha-size.svg | 65 -- .../ppd-freqpoly-alpha-binwidth-size.svg | 163 ----- .../ppc-intervals/ppc-intervals-default.svg | 466 ------------- .../ppc-intervals-grouped-default.svg | 615 ------------------ .../ppc-intervals-grouped-x-values.svg | 607 ----------------- .../ppc-intervals-interval-width.svg | 466 ------------- .../ppc-intervals/ppc-intervals-x-values.svg | 468 ------------- .../ppc-intervals/ppd-intervals-default.svg | 355 ---------- .../ppd-intervals-grouped-default.svg | 504 -------------- .../ppd-intervals-grouped-x-values.svg | 496 -------------- .../ppd-intervals-interval-width.svg | 355 ---------- .../ppc-intervals/ppd-intervals-x-values.svg | 357 ---------- .../ppc-loo/ppc-loo-intervals-default.svg | 460 ------------- .../ppc-loo/ppc-loo-intervals-order.svg | 450 ------------- .../_snaps/ppc-loo/ppc-loo-intervals-prob.svg | 460 ------------- tests/testthat/test-ppc-censoring.R | 18 +- tests/testthat/test-ppc-discrete.R | 10 +- tests/testthat/test-ppc-distributions.R | 48 +- tests/testthat/test-ppc-intervals.R | 4 +- 45 files changed, 56 insertions(+), 8228 deletions(-) delete mode 100644 tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-size-alpha.svg delete mode 100644 tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-size-alpha.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size-fatten.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size-fatten.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg delete mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-size-alpha.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-size-alpha.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-size.svg delete mode 100644 tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-size.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg delete mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg delete mode 100644 tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg delete mode 100644 tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg delete mode 100644 tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg diff --git a/R/mcmc-diagnostics.R b/R/mcmc-diagnostics.R index 2640c0f9b..c239f84a2 100644 --- a/R/mcmc-diagnostics.R +++ b/R/mcmc-diagnostics.R @@ -10,8 +10,9 @@ #' #' @template args-hist #' @param size Optional values to override [ggplot2::geom_point()]'s -#' default size (for `mcmc_rhat()`, `mcmc_neff()`) or -#' [ggplot2::geom_line()]'s default line width (for `mcmc_acf()`). +#' default size (for `mcmc_rhat()`, `mcmc_neff()`). +#' @param linewidth Optional value to override [ggplot2::geom_line()]'s +#' default line width (for `mcmc_acf()`). #' @param ... Currently ignored. #' #' @template return-ggplot-or-data diff --git a/R/mcmc-parcoord.R b/R/mcmc-parcoord.R index 0f0a2d7a6..4ef6e5203 100644 --- a/R/mcmc-parcoord.R +++ b/R/mcmc-parcoord.R @@ -13,7 +13,7 @@ #' @template args-regex_pars #' @template args-transformations #' @param ... Currently ignored. -#' @param size,alpha Arguments passed on to [ggplot2::geom_line()]. +#' @param size,alpha,linewidth Arguments passed on to [ggplot2::geom_line()]. #' @param np For models fit using [NUTS] (more generally, #' any [symplectic integrator](https://en.wikipedia.org/wiki/Symplectic_integrator)), #' an optional data frame providing NUTS diagnostic information. The data diff --git a/R/ppc-censoring.R b/R/ppc-censoring.R index 13da8f940..a77df7a2e 100644 --- a/R/ppc-censoring.R +++ b/R/ppc-censoring.R @@ -15,8 +15,8 @@ #' @family PPCs #' #' @template args-y-yrep -#' @param size,alpha Passed to the appropriate geom to control the appearance of -#' the `yrep` distributions. +#' @param size,alpha,linewidth Passed to the appropriate geom to control the +#' appearance of the `yrep` distributions. #' @param ... Currently only used internally. #' #' @template return-ggplot diff --git a/R/ppc-errors.R b/R/ppc-errors.R index e94ec1e1d..c1415763b 100644 --- a/R/ppc-errors.R +++ b/R/ppc-errors.R @@ -19,6 +19,7 @@ #' [ggplot2::geom_point()] to control the appearance of the points. For the #' binned error plot, arguments controlling the size of the outline and #' opacity of the shaded region indicating the 2-SE bounds. +#' @param linewidth For the binned error plot, the line width of the outline. #' #' @details #' All of these functions (aside from the `*_scatter_avg` functions) diff --git a/man/MCMC-diagnostics.Rd b/man/MCMC-diagnostics.Rd index d5f3ed4dc..3dd085f75 100644 --- a/man/MCMC-diagnostics.Rd +++ b/man/MCMC-diagnostics.Rd @@ -50,8 +50,7 @@ mcmc_acf_bar( \item{...}{Currently ignored.} \item{size}{Optional values to override \code{\link[ggplot2:geom_point]{ggplot2::geom_point()}}'s -default size (for \code{mcmc_rhat()}, \code{mcmc_neff()}) or -\code{\link[ggplot2:geom_path]{ggplot2::geom_line()}}'s default line width (for \code{mcmc_acf()}).} +default size (for \code{mcmc_rhat()}, \code{mcmc_neff()}).} \item{binwidth}{Passed to \code{\link[ggplot2:geom_histogram]{ggplot2::geom_histogram()}}, \code{\link[ggplot2:geom_ribbon]{ggplot2::geom_area()}}, and \code{\link[ggdist:stat_dots]{ggdist::stat_dots()}} to override the default binwidth.} @@ -96,6 +95,9 @@ then \strong{bayesplot} may use \code{scales="free"} as the default (depending on the plot) instead of the \strong{ggplot2} default of \code{scales="fixed"}.} \item{lags}{The number of lags to show in the autocorrelation plot.} + +\item{linewidth}{Optional value to override \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}}'s +default line width (for \code{mcmc_acf()}).} } \value{ The plotting functions return a ggplot object that can be further diff --git a/man/MCMC-distributions.Rd b/man/MCMC-distributions.Rd index 1c12fa2ac..71be98d79 100644 --- a/man/MCMC-distributions.Rd +++ b/man/MCMC-distributions.Rd @@ -180,7 +180,7 @@ parameter is transformed (e.g. \code{"t(sigma)"}). Note: due to partial argument matching \code{transformations} can be abbreviated for convenience in interactive use (e.g., \code{transform}).} -\item{...}{For dot plots, optional additional arguments to pass to [ggdist::stat_dots()].} +\item{...}{For dot plots, optional additional arguments to pass to \code{\link[ggdist:stat_dots]{ggdist::stat_dots()}}.} \item{facet_args}{A named list of arguments (other than \code{facets}) passed to \code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}} or \code{\link[ggplot2:facet_grid]{ggplot2::facet_grid()}} diff --git a/man/MCMC-parcoord.Rd b/man/MCMC-parcoord.Rd index a2aa092c3..a2dd361b8 100644 --- a/man/MCMC-parcoord.Rd +++ b/man/MCMC-parcoord.Rd @@ -79,7 +79,7 @@ abbreviated for convenience in interactive use (e.g., \code{transform}).} \item{...}{Currently ignored.} -\item{size, alpha}{Arguments passed on to \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}}.} +\item{size, alpha, linewidth}{Arguments passed on to \code{\link[ggplot2:geom_path]{ggplot2::geom_line()}}.} \item{np}{For models fit using \link{NUTS} (more generally, any \href{https://en.wikipedia.org/wiki/Symplectic_integrator}{symplectic integrator}), diff --git a/man/PPC-censoring.Rd b/man/PPC-censoring.Rd index b8d3901c3..c479355ad 100644 --- a/man/PPC-censoring.Rd +++ b/man/PPC-censoring.Rd @@ -60,8 +60,8 @@ posterior predictive draws may not be shown by default because of the controlled extrapolation. To display all posterior predictive draws, set \code{extrapolation_factor = Inf}.} -\item{size, alpha}{Passed to the appropriate geom to control the appearance of -the \code{yrep} distributions.} +\item{size, alpha, linewidth}{Passed to the appropriate geom to control the +appearance of the \code{yrep} distributions.} \item{group}{A grouping variable of the same length as \code{y}. Will be coerced to \link[base:factor]{factor} if not already a factor. diff --git a/man/PPC-errors.Rd b/man/PPC-errors.Rd index 299809f7f..b2f54d141 100644 --- a/man/PPC-errors.Rd +++ b/man/PPC-errors.Rd @@ -131,6 +131,8 @@ opacity of the shaded region indicating the 2-SE bounds.} posterior average. In both cases, the function should take a vector input and return a scalar statistic. The function name is displayed in the axis-label. Defaults to \code{"mean"}.} + +\item{linewidth}{For the binned error plot, the line width of the outline.} } \value{ The plotting functions return a ggplot object that can be further diff --git a/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-size-alpha.svg b/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-size-alpha.svg deleted file mode 100644 index 47b9fa1af..000000000 --- a/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-size-alpha.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1 - - - - - - - - - -2 - - - - - - - - - -0 -1 -2 -3 -4 -5 - - - - - - - -0 -1 -2 -3 -4 -5 - -0.0 -0.5 -1.0 - - - - - -y -y -r -e -p -ppc_km_overlay_grouped (size, alpha) - - diff --git a/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-size-alpha.svg b/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-size-alpha.svg deleted file mode 100644 index e2b518208..000000000 --- a/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-size-alpha.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.0 -0.5 -1.0 - - - - - - - - - - -0 -1 -2 -3 -4 -5 - - -y -y -r -e -p -ppc_km_overlay (size, alpha) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg deleted file mode 100644 index eebaca558..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -4 -8 -12 -16 - - - - - - - - - - - - -0 -1 -2 -3 -4 -5 -Count - - -y -r -e -p - -y -ppc_bars (default) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg deleted file mode 100644 index f315b86b9..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1 - - - - - - - - - -2 - - - - - - - - - -0 -1 -2 -3 -4 -5 - - - - - - - -0 -1 -2 -3 -4 -5 - -0.0 -2.5 -5.0 -7.5 -10.0 - - - - - -Count - - -y -r -e -p - -y -ppc_bars_grouped (default) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg deleted file mode 100644 index ada88498b..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -2 - - - - - - - - - -1 - - - - - - - - - -0 -1 -2 -3 -4 -5 - -0 -2 -4 -6 -8 - - - - - - -0 -2 -4 -6 -8 - - - - - -Count - - -y -r -e -p - -y -ppc_bars_grouped (facet_args, prob, size) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size-fatten.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size-fatten.svg deleted file mode 100644 index fd35e987a..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size-fatten.svg +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.0 -2.5 -5.0 -7.5 -10.0 -12.5 - - - - - - - - - - - - - -0 -1 -2 -3 -4 -5 -Count - - -y -r -e -p - -y -ppc_bars (prob=0.33, width, size, fatten) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size-fatten.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size-fatten.svg deleted file mode 100644 index c473580aa..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size-fatten.svg +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -4 -8 -12 -16 - - - - - - - - - - - - -0 -1 -2 -3 -4 -5 -Count - - -y -r -e -p - -y -ppc_bars (width, size, fatten) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg deleted file mode 100644 index 515ea4918..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -4 -8 -12 - - - - - - - - - - - -0 -1 -2 -3 -4 -5 -y -Count - - -y - - -y -r -e -p -ppc_rootogram ('discrete', bound_distinct=FALSE) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg deleted file mode 100644 index 8df075043..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -5 -10 - - - - - - - - - - -0 -1 -2 -3 -4 -5 -y -Count -y - -w -i -t -h -i -n - -b -o -u -n -d -s - - -In -Out - - -y -r -e -p -ppc_rootogram (style='discrete', prob, size) - - diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg deleted file mode 100644 index c9cfa0810..000000000 --- a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1 -0 -1 -2 -3 - - - - - - - - - -0 -2 -4 -y - -C -o -u -n -t - -Observed - - -Expected -ppc_rootogram (style='hanging', prob, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-size.svg b/tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-size.svg deleted file mode 100644 index f9b70a1c7..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-size.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 - - - - - - - - - - - - - - - - -y -y -r -e -p -ppc_boxplot (alpha, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-size.svg b/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-size.svg deleted file mode 100644 index 2f87f1d6d..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-size.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 - - -y -y -r -e -p -ppc_dens_overlay (alpha, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-size.svg b/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-size.svg deleted file mode 100644 index 5a55e5751..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-size.svg +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -C - - - - - - - - - -D - - - - - - - - - -A - - - - - - - - - -B - - - - - - --2 -0 -2 - - - - --2 -0 -2 - - - - -y -y -r -e -p -ppc_dens_overlay_grouped (alpha, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-size-alpha.svg b/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-size-alpha.svg deleted file mode 100644 index e35e25a85..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-size-alpha.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.0 -0.5 -1.0 - - - - - - - - - - -0 -1 -2 -3 -4 -5 - - -y -y -r -e -p -ppc_ecdf_overlay (discrete, size, alpha) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-size-alpha.svg b/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-size-alpha.svg deleted file mode 100644 index cb9301ac4..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-size-alpha.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1 - - - - - - - - - -2 - - - - - - - - - -0 -1 -2 -3 -4 -5 - - - - - - - -0 -1 -2 -3 -4 -5 - -0.0 -0.5 -1.0 - - - - - -y -y -r -e -p -ppc_ecdf_overlay_grouped (discrete, size, alpha) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-size.svg b/tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-size.svg deleted file mode 100644 index 5fb2acd05..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-size.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --5.0 --2.5 -0.0 -2.5 -5.0 - - - - - - --5.0 --2.5 -0.0 -2.5 -5.0 - - - - - - --5.0 --2.5 -0.0 -2.5 -5.0 - - - - - - - -y -y -r -e -p -ppc_freqpoly (alpha, binwidth, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-size.svg b/tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-size.svg deleted file mode 100644 index a73bf0881..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-size.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 - - - - -ppd_boxplot (alpha, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-size.svg b/tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-size.svg deleted file mode 100644 index b7098aea8..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-size.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 -0 -2 -ppd_dens_overlay (alpha, size) - - diff --git a/tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-size.svg b/tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-size.svg deleted file mode 100644 index 53968e830..000000000 --- a/tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-size.svg +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --5.0 --2.5 -0.0 -2.5 -5.0 - - - - - - --5.0 --2.5 -0.0 -2.5 -5.0 - - - - - - --5.0 --2.5 -0.0 -2.5 -5.0 - - - -ppd_freqpoly (alpha, binwidth, size) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg deleted file mode 100644 index 4ed73687a..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg +++ /dev/null @@ -1,466 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - -0 -25 -50 -75 -100 -Data point (index) - - - - -y -y -r -e -p -ppc_intervals (default) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg deleted file mode 100644 index 50546836d..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg +++ /dev/null @@ -1,615 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -C - - - - - - - - - -D - - - - - - - - - -A - - - - - - - - - -B - - - - - - - - - -50 -55 -60 -65 -70 -75 - - - - - - - -75 -80 -85 -90 -95 -100 - - - - - - - -0 -5 -10 -15 -20 -25 - - - - - - - -25 -30 -35 -40 -45 -50 - --2 --1 -0 -1 -2 -3 - - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - -Data point (index) - - - - -y -y -r -e -p -ppc_intervals_grouped (default) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg deleted file mode 100644 index f5997757f..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg +++ /dev/null @@ -1,607 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -C - - - - - - - - - -D - - - - - - - - - -A - - - - - - - - - -B - - - - - - - - --2 --1 -0 -1 -2 - - - - - --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - - --2 --1 -0 -1 -2 -3 - --2 --1 -0 -1 -2 -3 - - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - -x - - - - -y -y -r -e -p -ppc_intervals_grouped (x values) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg deleted file mode 100644 index ffac8c6fa..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg +++ /dev/null @@ -1,466 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - -0 -25 -50 -75 -100 -Data point (index) - - - - -y -y -r -e -p -ppc_intervals (interval width) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg deleted file mode 100644 index 7103c2307..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg +++ /dev/null @@ -1,468 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 -x - - - - -y -y -r -e -p -ppc_intervals (x values) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg deleted file mode 100644 index f401a74b4..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 - - - - - - - - - - - -0 -25 -50 -75 -100 -Data point (index) -ppd_intervals (default) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg deleted file mode 100644 index 4a443550b..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -C - - - - - - - - - -D - - - - - - - - - -A - - - - - - - - - -B - - - - - - - - - -50 -55 -60 -65 -70 -75 - - - - - - - -75 -80 -85 -90 -95 -100 - - - - - - - -0 -5 -10 -15 -20 -25 - - - - - - - -25 -30 -35 -40 -45 -50 - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - -Data point (index) -ppd_intervals_grouped (default) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg deleted file mode 100644 index bcbbdfb8b..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg +++ /dev/null @@ -1,496 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -C - - - - - - - - - -D - - - - - - - - - -A - - - - - - - - - -B - - - - - - - - --2 --1 -0 -1 -2 - - - - - --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - - --2 --1 -0 -1 -2 -3 - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - - --2 --1 -0 -1 -2 - - - - - -x -ppd_intervals_grouped (x values) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg deleted file mode 100644 index 16b407d83..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 - - - - - - - - - - - -0 -25 -50 -75 -100 -Data point (index) -ppd_intervals (interval width) - - diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg deleted file mode 100644 index 6b97f0637..000000000 --- a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 -x -ppd_intervals (x values) - - diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg deleted file mode 100644 index 7581eea87..000000000 --- a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg +++ /dev/null @@ -1,460 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -20 -30 -40 - - - - - - - - - -0 -25 -50 -75 -100 -Data point (index) - - - - -y -y -r -e -p -ppc_loo_intervals (default) - - diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg deleted file mode 100644 index 917cab2cd..000000000 --- a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -20 -30 -40 - - - - -Ordered by median - - - - -y -y -r -e -p -ppc_loo_intervals (order) - - diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg deleted file mode 100644 index d847f56fb..000000000 --- a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg +++ /dev/null @@ -1,460 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -20 -30 -40 - - - - - - - - - -0 -25 -50 -75 -100 -Data point (index) - - - - -y -y -r -e -p -ppc_loo_intervals (prob) - - diff --git a/tests/testthat/test-ppc-censoring.R b/tests/testthat/test-ppc-censoring.R index 2224df7ba..c315e2520 100644 --- a/tests/testthat/test-ppc-censoring.R +++ b/tests/testthat/test-ppc-censoring.R @@ -2,8 +2,8 @@ source(test_path("data-for-ppc-tests.R")) test_that("ppc_km_overlay returns a ggplot object", { skip_if_not_installed("ggfortify") - expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, size = 0.5, alpha = 0.2, extrapolation_factor = Inf)) - expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, size = 0.5, alpha = 0.2, extrapolation_factor = 1)) + expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, linewidth = 0.5, alpha = 0.2, extrapolation_factor = Inf)) + expect_gg(ppc_km_overlay(y, yrep, status_y = status_y, left_truncation_y = left_truncation_y, linewidth = 0.5, alpha = 0.2, extrapolation_factor = 1)) expect_gg(ppc_km_overlay(y2, yrep2, status_y = status_y2)) }) @@ -12,15 +12,15 @@ test_that("ppc_km_overlay_grouped returns a ggplot object", { expect_gg(ppc_km_overlay_grouped(y, yrep, group, status_y = status_y, left_truncation_y = left_truncation_y, - size = 0.5, alpha = 0.2)) + linewidth = 0.5, alpha = 0.2)) expect_gg(ppc_km_overlay_grouped(y, yrep, as.numeric(group), status_y = status_y, left_truncation_y = left_truncation_y, - size = 0.5, alpha = 0.2)) + linewidth = 0.5, alpha = 0.2)) expect_gg(ppc_km_overlay_grouped(y, yrep, as.integer(group), status_y = status_y, left_truncation_y = left_truncation_y, - size = 0.5, alpha = 0.2)) + linewidth = 0.5, alpha = 0.2)) expect_gg(ppc_km_overlay_grouped(y2, yrep2, group2, status_y = status_y2)) @@ -89,9 +89,9 @@ test_that("ppc_km_overlay renders correctly", { vdiff_y2, vdiff_yrep2, status_y = vdiff_status_y2, - size = 2, + linewidth = 2, alpha = .2) - vdiffr::expect_doppelganger("ppc_km_overlay (size, alpha)", p_custom) + vdiffr::expect_doppelganger("ppc_km_overlay (linewidth, alpha)", p_custom) p_base2 <- ppc_km_overlay(vdiff_y3, vdiff_yrep3, status_y = vdiff_status_y3) vdiffr::expect_doppelganger("ppc_km_overlay (default 2)", p_base2) @@ -138,12 +138,12 @@ test_that("ppc_km_overlay_grouped renders correctly", { vdiff_yrep2, vdiff_group2, status_y = vdiff_status_y2, - size = 2, + linewidth = 2, alpha = .2 ) vdiffr::expect_doppelganger( - "ppc_km_overlay_grouped (size, alpha)", + "ppc_km_overlay_grouped (linewidth, alpha)", p_custom ) diff --git a/tests/testthat/test-ppc-discrete.R b/tests/testthat/test-ppc-discrete.R index 005fdc94e..5cd731e74 100644 --- a/tests/testthat/test-ppc-discrete.R +++ b/tests/testthat/test-ppc-discrete.R @@ -112,12 +112,11 @@ test_that("ppc_bars renders correctly", { y = vdiff_y2, yrep = vdiff_yrep2, width = 0.5, - size = 0.5, - fatten = 5 + size = 2.5 ) vdiffr::expect_doppelganger( - title = "ppc_bars (width, size, fatten)", + title = "ppc_bars (width, size)", fig = p_custom) p_custom_prob <- ppc_bars( @@ -125,12 +124,11 @@ test_that("ppc_bars renders correctly", { yrep = vdiff_yrep2, prob = 0.33, width = 0.5, - size = 0.5, - fatten = 5 + size = 2.5 ) vdiffr::expect_doppelganger( - title = "ppc_bars (prob=0.33, width, size, fatten)", + title = "ppc_bars (prob=0.33, width, size)", fig = p_custom_prob) }) diff --git a/tests/testthat/test-ppc-distributions.R b/tests/testthat/test-ppc-distributions.R index 93b52e0ad..1a53edae7 100644 --- a/tests/testthat/test-ppc-distributions.R +++ b/tests/testthat/test-ppc-distributions.R @@ -2,11 +2,11 @@ source(test_path("data-for-ppc-tests.R")) test_that("ppc_dens_overlay returns a ggplot object", { expect_gg(ppc_dens_overlay(y, yrep)) - expect_gg(ppc_dens_overlay(y2, yrep2, size = 0.5, alpha = 0.2)) + expect_gg(ppc_dens_overlay(y2, yrep2, linewidth = 0.5, alpha = 0.2)) # ppd versions expect_gg(ppd_dens_overlay(yrep)) - expect_gg(ppd_dens_overlay(yrep2, size = 0.5, alpha = 0.2)) + expect_gg(ppd_dens_overlay(yrep2, linewidth = 0.5, alpha = 0.2)) }) test_that("density PPC/PPD plots accept bounds", { @@ -42,11 +42,11 @@ test_that("density PPC/PPD plots reject invalid bounds", { }) test_that("ppc_ecdf_overlay returns a ggplot object", { - expect_gg(ppc_ecdf_overlay(y, yrep, size = 0.5, alpha = 0.2)) + expect_gg(ppc_ecdf_overlay(y, yrep, linewidth = 0.5, alpha = 0.2)) expect_gg(ppc_ecdf_overlay(y2, yrep2)) # ppd versions - expect_gg(ppd_ecdf_overlay(yrep, size = 0.5, alpha = 0.2)) + expect_gg(ppd_ecdf_overlay(yrep, linewidth = 0.5, alpha = 0.2)) expect_gg(ppd_ecdf_overlay(yrep2)) }) @@ -58,7 +58,7 @@ test_that("ppc_dens,pp_hist,ppc_freqpoly,ppc_boxplot return ggplot objects", { expect_gg(ppc_dens(y, yrep[1:8, ])) expect_gg(ppc_dens(y2, yrep2)) - expect_gg(ppc_freqpoly(y, yrep[1:8, ], binwidth = 2, size = 2, alpha = 0.1)) + expect_gg(ppc_freqpoly(y, yrep[1:8, ], binwidth = 2, linewidth = 2, alpha = 0.1)) expect_gg(ppc_freqpoly(y2, yrep2, binwidth = 0.1)) expect_gg(ppc_boxplot(y, yrep[1,, drop = FALSE])) @@ -79,7 +79,7 @@ test_that("ppc_dens,pp_hist,ppc_freqpoly,ppc_boxplot return ggplot objects", { expect_gg(ppd_dens(yrep[1:8, ])) expect_gg(ppd_dens(yrep2)) - expect_gg(ppd_freqpoly(yrep[1:8, ], binwidth = 2, size = 2, alpha = 0.1)) + expect_gg(ppd_freqpoly(yrep[1:8, ], binwidth = 2, linewidth = 2, alpha = 0.1)) expect_gg(ppd_freqpoly(yrep2, binwidth = 0.1)) expect_gg(ppd_boxplot(yrep[1,, drop = FALSE])) @@ -164,10 +164,10 @@ test_that("ppc_freqpoly renders correctly", { y = vdiff_y, yrep = vdiff_yrep[1:8, ], binwidth = 2, - size = 2, + linewidth = 2, alpha = 0.1) vdiffr::expect_doppelganger( - title = "ppc_freqpoly (alpha, binwidth, size)", + title = "ppc_freqpoly (alpha, binwidth, linewidth)", fig = p_custom) # ppd versions @@ -177,10 +177,10 @@ test_that("ppc_freqpoly renders correctly", { p_custom <- ppd_freqpoly( ypred = vdiff_yrep[1:8, ], binwidth = 2, - size = 2, + linewidth = 2, alpha = 0.1) vdiffr::expect_doppelganger( - title = "ppd_freqpoly (alpha, binwidth, size)", + title = "ppd_freqpoly (alpha, binwidth, linewidth)", fig = p_custom) }) @@ -208,8 +208,8 @@ test_that("ppc_boxplot renders correctly", { p_no_notch <- ppc_boxplot(vdiff_y, vdiff_yrep[1:8, ], notch = FALSE) vdiffr::expect_doppelganger("ppc_boxplot (no notch)", p_no_notch) - p_custom <- ppc_boxplot(vdiff_y, vdiff_yrep[1:8, ], size = 1.5, alpha = .5) - vdiffr::expect_doppelganger("ppc_boxplot (alpha, size)", p_custom) + p_custom <- ppc_boxplot(vdiff_y, vdiff_yrep[1:8, ], linewidth = 1.5, alpha = .5) + vdiffr::expect_doppelganger("ppc_boxplot (alpha, linewidth)", p_custom) # ppd versions p_base <- ppd_boxplot(vdiff_yrep[1:8, ]) @@ -218,8 +218,8 @@ test_that("ppc_boxplot renders correctly", { p_no_notch <- ppd_boxplot(vdiff_yrep[1:8, ], notch = FALSE) vdiffr::expect_doppelganger("ppd_boxplot (no notch)", p_no_notch) - p_custom <- ppd_boxplot(vdiff_yrep[1:8, ], size = 1.5, alpha = .5) - vdiffr::expect_doppelganger("ppd_boxplot (alpha, size)", p_custom) + p_custom <- ppd_boxplot(vdiff_yrep[1:8, ], linewidth = 1.5, alpha = .5) + vdiffr::expect_doppelganger("ppd_boxplot (alpha, linewidth)", p_custom) }) test_that("ppc_dots renders correctly", { @@ -270,12 +270,12 @@ test_that("ppc_ecdf_overlay renders correctly", { vdiff_y2, vdiff_yrep2, discrete = TRUE, - size = 2, + linewidth = 2, alpha = .2 ) vdiffr::expect_doppelganger( - "ppc_ecdf_overlay (discrete, size, alpha)", + "ppc_ecdf_overlay (discrete, linewidth, alpha)", p_custom ) }) @@ -293,12 +293,12 @@ test_that("ppc_ecdf_overlay_grouped renders correctly", { vdiff_yrep2, vdiff_group2, discrete = TRUE, - size = 2, + linewidth = 2, alpha = .2 ) vdiffr::expect_doppelganger( - "ppc_ecdf_overlay_grouped (discrete, size, alpha)", + "ppc_ecdf_overlay_grouped (discrete, linewidth, alpha)", p_custom ) }) @@ -324,8 +324,8 @@ test_that("ppc_dens_overlay renders correctly", { p_base <- ppc_dens_overlay(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_dens_overlay (default)", p_base) - p_custom <- ppc_dens_overlay(vdiff_y, vdiff_yrep, size = 1, alpha = 0.2) - vdiffr::expect_doppelganger("ppc_dens_overlay (alpha, size)", p_custom) + p_custom <- ppc_dens_overlay(vdiff_y, vdiff_yrep, linewidth = 1, alpha = 0.2) + vdiffr::expect_doppelganger("ppc_dens_overlay (alpha, linewidth)", p_custom) p_bounds <- suppressWarnings(ppc_dens_overlay(vdiff_y, vdiff_yrep, bounds = c(0, Inf))) suppressWarnings(vdiffr::expect_doppelganger("ppc_dens_overlay (bounds)", p_bounds)) @@ -334,8 +334,8 @@ test_that("ppc_dens_overlay renders correctly", { p_base <- ppd_dens_overlay(vdiff_yrep) vdiffr::expect_doppelganger("ppd_dens_overlay (default)", p_base) - p_custom <- ppd_dens_overlay(vdiff_yrep, size = 1, alpha = 0.2) - vdiffr::expect_doppelganger("ppd_dens_overlay (alpha, size)", p_custom) + p_custom <- ppd_dens_overlay(vdiff_yrep, linewidth = 1, alpha = 0.2) + vdiffr::expect_doppelganger("ppd_dens_overlay (alpha, linewidth)", p_custom) p_bounds <- suppressWarnings(ppd_dens_overlay(vdiff_yrep, bounds = c(0, Inf))) suppressWarnings(vdiffr::expect_doppelganger("ppd_dens_overlay (bounds)", p_bounds)) @@ -353,12 +353,12 @@ test_that("ppc_dens_overlay_grouped renders correctly", { vdiff_y, vdiff_yrep, vdiff_group, - size = 1, + linewidth = 1, alpha = 0.2 ) vdiffr::expect_doppelganger( - "ppc_dens_overlay_grouped (alpha, size)", + "ppc_dens_overlay_grouped (alpha, linewidth)", p_custom ) }) diff --git a/tests/testthat/test-ppc-intervals.R b/tests/testthat/test-ppc-intervals.R index a14993039..acfc139a2 100644 --- a/tests/testthat/test-ppc-intervals.R +++ b/tests/testthat/test-ppc-intervals.R @@ -2,7 +2,7 @@ source(test_path("data-for-ppc-tests.R")) test_that("ppc_intervals returns ggplot object", { expect_gg(ppc_intervals(y, yrep)) - expect_gg(ppc_intervals(y, yrep, size = 2, fatten = 1)) + expect_gg(ppc_intervals(y, yrep, size = 2)) expect_gg(ppc_intervals(y, yrep, x = seq(1, 2 * length(y), by = 2))) expect_gg(ppc_intervals(y2, yrep2)) @@ -13,7 +13,7 @@ test_that("ppc_intervals returns ggplot object", { test_that("ppc_ribbon returns ggplot object", { expect_gg(ppc_ribbon(y, yrep, prob = 0.5)) - expect_gg(ppc_ribbon(y, yrep, alpha = 0, size = .5)) + expect_gg(ppc_ribbon(y, yrep, alpha = 0, linewidth = .5)) expect_gg(ppc_ribbon(y2, yrep2, x = rnorm(length(y2)), prob = 0.5)) # ppd versions From 5ed26fa38bcfec39ae078eef607efb67dc91a16b Mon Sep 17 00:00:00 2001 From: ishaan-arora-1 Date: Fri, 13 Mar 2026 17:37:05 +0530 Subject: [PATCH 3/4] Add missing vdiffr snapshots for updated visual tests The code changes altered visual output for intervals, distributions, discrete, censoring, and loo plots, but the corresponding vdiffr SVG snapshots were never regenerated. This adds all 32 missing snapshots. --- ...ppc-km-overlay-grouped-linewidth-alpha.svg | 133 ++++ .../ppc-km-overlay-linewidth-alpha.svg | 73 +++ .../_snaps/ppc-discrete/ppc-bars-default.svg | 83 +++ .../ppc-discrete/ppc-bars-grouped-default.svg | 147 +++++ .../ppc-bars-grouped-facet-args-prob-size.svg | 145 +++++ .../ppc-bars-prob-0-33-width-size.svg | 85 +++ .../ppc-discrete/ppc-bars-width-size.svg | 83 +++ ...ootogram-discrete-bound-distinct-false.svg | 83 +++ ...ppc-rootogram-style-discrete-prob-size.svg | 97 +++ .../ppc-rootogram-style-hanging-prob-size.svg | 73 +++ .../ppc-boxplot-alpha-linewidth.svg | 105 +++ .../ppc-dens-overlay-alpha-linewidth.svg | 73 +++ ...c-dens-overlay-grouped-alpha-linewidth.svg | 234 +++++++ ...-ecdf-overlay-discrete-linewidth-alpha.svg | 73 +++ ...erlay-grouped-discrete-linewidth-alpha.svg | 133 ++++ .../ppc-freqpoly-alpha-binwidth-linewidth.svg | 185 ++++++ .../ppd-boxplot-alpha-linewidth.svg | 84 +++ .../ppd-dens-overlay-alpha-linewidth.svg | 65 ++ .../ppd-freqpoly-alpha-binwidth-linewidth.svg | 163 +++++ .../ppc-intervals/ppc-intervals-default.svg | 466 +++++++++++++ .../ppc-intervals-grouped-default.svg | 615 ++++++++++++++++++ .../ppc-intervals-grouped-x-values.svg | 607 +++++++++++++++++ .../ppc-intervals-interval-width.svg | 466 +++++++++++++ .../ppc-intervals/ppc-intervals-x-values.svg | 468 +++++++++++++ .../ppc-intervals/ppd-intervals-default.svg | 355 ++++++++++ .../ppd-intervals-grouped-default.svg | 504 ++++++++++++++ .../ppd-intervals-grouped-x-values.svg | 496 ++++++++++++++ .../ppd-intervals-interval-width.svg | 355 ++++++++++ .../ppc-intervals/ppd-intervals-x-values.svg | 357 ++++++++++ .../ppc-loo/ppc-loo-intervals-default.svg | 460 +++++++++++++ .../ppc-loo/ppc-loo-intervals-order.svg | 450 +++++++++++++ .../_snaps/ppc-loo/ppc-loo-intervals-prob.svg | 460 +++++++++++++ 32 files changed, 8176 insertions(+) create mode 100644 tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-linewidth-alpha.svg create mode 100644 tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-linewidth-alpha.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg create mode 100644 tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-linewidth-alpha.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-linewidth-alpha.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-linewidth.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg create mode 100644 tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg create mode 100644 tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg create mode 100644 tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg create mode 100644 tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg diff --git a/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-linewidth-alpha.svg b/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-linewidth-alpha.svg new file mode 100644 index 000000000..1f4ca07c8 --- /dev/null +++ b/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-grouped-linewidth-alpha.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 + + + + + + + + + +2 + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + +0 +1 +2 +3 +4 +5 + +0.0 +0.5 +1.0 + + + + + +y +y +r +e +p +ppc_km_overlay_grouped (linewidth, alpha) + + diff --git a/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-linewidth-alpha.svg b/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-linewidth-alpha.svg new file mode 100644 index 000000000..6db8aac58 --- /dev/null +++ b/tests/testthat/_snaps/ppc-censoring/ppc-km-overlay-linewidth-alpha.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.0 +0.5 +1.0 + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + +y +y +r +e +p +ppc_km_overlay (linewidth, alpha) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg new file mode 100644 index 000000000..fb1278472 --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-bars-default.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +4 +8 +12 +16 + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 +Count + + +y +r +e +p + +y +ppc_bars (default) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg new file mode 100644 index 000000000..e63a581ae --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-default.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 + + + + + + + + + +2 + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + +0 +1 +2 +3 +4 +5 + +0.0 +2.5 +5.0 +7.5 +10.0 + + + + + +Count + + +y +r +e +p + +y +ppc_bars_grouped (default) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg new file mode 100644 index 000000000..cb6212b75 --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-bars-grouped-facet-args-prob-size.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +2 + + + + + + + + + +1 + + + + + + + + + +0 +1 +2 +3 +4 +5 + +0 +2 +4 +6 +8 + + + + + + +0 +2 +4 +6 +8 + + + + + +Count + + +y +r +e +p + +y +ppc_bars_grouped (facet_args, prob, size) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size.svg new file mode 100644 index 000000000..71f8c0d92 --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-bars-prob-0-33-width-size.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.0 +2.5 +5.0 +7.5 +10.0 +12.5 + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 +Count + + +y +r +e +p + +y +ppc_bars (prob=0.33, width, size) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size.svg new file mode 100644 index 000000000..e251d2215 --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-bars-width-size.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +4 +8 +12 +16 + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 +Count + + +y +r +e +p + +y +ppc_bars (width, size) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg new file mode 100644 index 000000000..5542d47b4 --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-discrete-bound-distinct-false.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +4 +8 +12 + + + + + + + + + + + +0 +1 +2 +3 +4 +5 +y +Count + + +y + + +y +r +e +p +ppc_rootogram ('discrete', bound_distinct=FALSE) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg new file mode 100644 index 000000000..2b06a032e --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-discrete-prob-size.svg @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +5 +10 + + + + + + + + + + +0 +1 +2 +3 +4 +5 +y +Count +y + +w +i +t +h +i +n + +b +o +u +n +d +s + + +In +Out + + +y +r +e +p +ppc_rootogram (style='discrete', prob, size) + + diff --git a/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg new file mode 100644 index 000000000..845ae4bb1 --- /dev/null +++ b/tests/testthat/_snaps/ppc-discrete/ppc-rootogram-style-hanging-prob-size.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1 +0 +1 +2 +3 + + + + + + + + + +0 +2 +4 +y + +C +o +u +n +t + +Observed + + +Expected +ppc_rootogram (style='hanging', prob, size) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-linewidth.svg new file mode 100644 index 000000000..ca90704bb --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppc-boxplot-alpha-linewidth.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 + + + + + + + + + + + + + + + + +y +y +r +e +p +ppc_boxplot (alpha, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-linewidth.svg new file mode 100644 index 000000000..758a2a916 --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-alpha-linewidth.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 + + +y +y +r +e +p +ppc_dens_overlay (alpha, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-linewidth.svg new file mode 100644 index 000000000..113ae631e --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppc-dens-overlay-grouped-alpha-linewidth.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C + + + + + + + + + +D + + + + + + + + + +A + + + + + + + + + +B + + + + + + +-2 +0 +2 + + + + +-2 +0 +2 + + + + +y +y +r +e +p +ppc_dens_overlay_grouped (alpha, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-linewidth-alpha.svg b/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-linewidth-alpha.svg new file mode 100644 index 000000000..d023f11a7 --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-discrete-linewidth-alpha.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.0 +0.5 +1.0 + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + +y +y +r +e +p +ppc_ecdf_overlay (discrete, linewidth, alpha) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-linewidth-alpha.svg b/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-linewidth-alpha.svg new file mode 100644 index 000000000..86259ec03 --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppc-ecdf-overlay-grouped-discrete-linewidth-alpha.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 + + + + + + + + + +2 + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + +0 +1 +2 +3 +4 +5 + +0.0 +0.5 +1.0 + + + + + +y +y +r +e +p +ppc_ecdf_overlay_grouped (discrete, linewidth, alpha) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-linewidth.svg new file mode 100644 index 000000000..552438b4d --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppc-freqpoly-alpha-binwidth-linewidth.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-5.0 +-2.5 +0.0 +2.5 +5.0 + + + + + + +-5.0 +-2.5 +0.0 +2.5 +5.0 + + + + + + +-5.0 +-2.5 +0.0 +2.5 +5.0 + + + + + + + +y +y +r +e +p +ppc_freqpoly (alpha, binwidth, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-linewidth.svg new file mode 100644 index 000000000..1abbd6e59 --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppd-boxplot-alpha-linewidth.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 + + + + +ppd_boxplot (alpha, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-linewidth.svg new file mode 100644 index 000000000..2eafcdd75 --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppd-dens-overlay-alpha-linewidth.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +ppd_dens_overlay (alpha, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-linewidth.svg b/tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-linewidth.svg new file mode 100644 index 000000000..1e913cdfd --- /dev/null +++ b/tests/testthat/_snaps/ppc-distributions/ppd-freqpoly-alpha-binwidth-linewidth.svg @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-5.0 +-2.5 +0.0 +2.5 +5.0 + + + + + + +-5.0 +-2.5 +0.0 +2.5 +5.0 + + + + + + +-5.0 +-2.5 +0.0 +2.5 +5.0 + + + +ppd_freqpoly (alpha, binwidth, linewidth) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg new file mode 100644 index 000000000..64950002d --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-default.svg @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 + + + + + + + + + + + + +0 +25 +50 +75 +100 +Data point (index) + + + + +y +y +r +e +p +ppc_intervals (default) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg new file mode 100644 index 000000000..9d467f4d7 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-default.svg @@ -0,0 +1,615 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C + + + + + + + + + +D + + + + + + + + + +A + + + + + + + + + +B + + + + + + + + + +50 +55 +60 +65 +70 +75 + + + + + + + +75 +80 +85 +90 +95 +100 + + + + + + + +0 +5 +10 +15 +20 +25 + + + + + + + +25 +30 +35 +40 +45 +50 + +-2 +-1 +0 +1 +2 +3 + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + +Data point (index) + + + + +y +y +r +e +p +ppc_intervals_grouped (default) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg new file mode 100644 index 000000000..cb5559dd2 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-grouped-x-values.svg @@ -0,0 +1,607 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C + + + + + + + + + +D + + + + + + + + + +A + + + + + + + + + +B + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + + +-2 +-1 +0 +1 +2 +3 + +-2 +-1 +0 +1 +2 +3 + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + +x + + + + +y +y +r +e +p +ppc_intervals_grouped (x values) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg new file mode 100644 index 000000000..bd85ade94 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-interval-width.svg @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 + + + + + + + + + + + + +0 +25 +50 +75 +100 +Data point (index) + + + + +y +y +r +e +p +ppc_intervals (interval width) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg new file mode 100644 index 000000000..f298e60e3 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppc-intervals-x-values.svg @@ -0,0 +1,468 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 +x + + + + +y +y +r +e +p +ppc_intervals (x values) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg new file mode 100644 index 000000000..9199bf576 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-default.svg @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + + + + + + +0 +25 +50 +75 +100 +Data point (index) +ppd_intervals (default) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg new file mode 100644 index 000000000..e591b41a1 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-default.svg @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C + + + + + + + + + +D + + + + + + + + + +A + + + + + + + + + +B + + + + + + + + + +50 +55 +60 +65 +70 +75 + + + + + + + +75 +80 +85 +90 +95 +100 + + + + + + + +0 +5 +10 +15 +20 +25 + + + + + + + +25 +30 +35 +40 +45 +50 + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + +Data point (index) +ppd_intervals_grouped (default) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg new file mode 100644 index 000000000..2090f322d --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-grouped-x-values.svg @@ -0,0 +1,496 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C + + + + + + + + + +D + + + + + + + + + +A + + + + + + + + + +B + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + + +-2 +-1 +0 +1 +2 +3 + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +-2 +-1 +0 +1 +2 + + + + + +x +ppd_intervals_grouped (x values) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg new file mode 100644 index 000000000..26894b276 --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-interval-width.svg @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + + + + + + +0 +25 +50 +75 +100 +Data point (index) +ppd_intervals (interval width) + + diff --git a/tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg new file mode 100644 index 000000000..05b1f7d3d --- /dev/null +++ b/tests/testthat/_snaps/ppc-intervals/ppd-intervals-x-values.svg @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 +x +ppd_intervals (x values) + + diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg new file mode 100644 index 000000000..9d4990dbd --- /dev/null +++ b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-default.svg @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +20 +30 +40 + + + + + + + + + +0 +25 +50 +75 +100 +Data point (index) + + + + +y +y +r +e +p +ppc_loo_intervals (default) + + diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg new file mode 100644 index 000000000..ae07b0503 --- /dev/null +++ b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-order.svg @@ -0,0 +1,450 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +20 +30 +40 + + + + +Ordered by median + + + + +y +y +r +e +p +ppc_loo_intervals (order) + + diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg new file mode 100644 index 000000000..d84843163 --- /dev/null +++ b/tests/testthat/_snaps/ppc-loo/ppc-loo-intervals-prob.svg @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +20 +30 +40 + + + + + + + + + +0 +25 +50 +75 +100 +Data point (index) + + + + +y +y +r +e +p +ppc_loo_intervals (prob) + + From 993325f551a6cf5fb25678a2f7a69066bf50fc08 Mon Sep 17 00:00:00 2001 From: ishaan-arora-1 Date: Fri, 13 Mar 2026 20:03:17 +0530 Subject: [PATCH 4/4] Regenerate vdiffr snapshots for R 4.5.3 R 4.5.3 (2026-03-11) produces slightly different SVG output, causing 16 snapshot mismatches in mcmc-diagnostics, mcmc-nuts, and ppc-test-statistics tests. --- .../mcmc-diagnostics/mcmc-neff-default.svg | 182 +++++------ .../mcmc-neff-hist-binwidth.svg | 234 +++++++------- .../mcmc-neff-hist-default.svg | 288 +++++++++--------- .../mcmc-neff-missing-levels.svg | 122 ++++---- .../mcmc-nuts/mcmc-nuts-energy-default.svg | 10 +- .../mcmc-nuts/mcmc-nuts-energy-merged.svg | 8 +- .../ppd-stat-2d-default.svg | 32 +- .../ppd-stat-2d-stat-size-alpha.svg | 32 +- .../ppc-test-statistics/ppd-stat-default.svg | 24 +- .../ppd-stat-discrete-stat.svg | 24 +- .../ppd-stat-freqpoly-grouped-default.svg | 22 +- ...d-stat-freqpoly-grouped-stat-facets-bw.svg | 22 +- .../ppd-stat-grouped-default.svg | 24 +- .../ppd-stat-grouped-discrete-stat.svg | 24 +- ...-stat-grouped-stat-facet-args-binwidth.svg | 24 +- .../ppd-stat-stat-binwidth-freq.svg | 24 +- 16 files changed, 548 insertions(+), 548 deletions(-) diff --git a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-default.svg b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-default.svg index cbf23ff6c..181537b08 100644 --- a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-default.svg +++ b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-default.svg @@ -20,106 +20,106 @@ - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - -0 -0.1 -0.25 -0.5 -0.75 -1 -N + + + + + + + + +0 +0.1 +0.25 +0.5 +0.75 +1 +N e f f - -N - - - - - - -N -e -f -f - -N - -0.1 -N -e -f -f - -N - -0.5 -N -e -f -f - -N -> -0.5 + +N + + + + + + +N +e +f +f + +N + +0.1 +N +e +f +f + +N + +0.5 +N +e +f +f + +N +> +0.5 mcmc_neff (default) diff --git a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-binwidth.svg b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-binwidth.svg index 8c2fe3e63..fc1bfeae5 100644 --- a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-binwidth.svg +++ b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-binwidth.svg @@ -20,131 +20,131 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -0.00 -0.25 -0.50 -0.75 + +0.00 +0.25 +0.50 +0.75 1.00 - - - - - - - - - - - -0.00 -0.25 -0.50 -0.75 -1.00 -N + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +N e f f - -N - - - -N -e -f -f - -N - -0.1 -N -e -f -f - -N - -0.5 -N -e -f -f - -N -> -0.5 + +N + + + +N +e +f +f + +N + +0.1 +N +e +f +f + +N + +0.5 +N +e +f +f + +N +> +0.5 mcmc_neff_hist (binwidth) diff --git a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-default.svg b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-default.svg index 89485ae37..7ae790079 100644 --- a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-default.svg +++ b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-hist-default.svg @@ -20,158 +20,158 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -0.00 -0.25 -0.50 -0.75 + +0.00 +0.25 +0.50 +0.75 1.00 - - - - - - - - - - - -0.00 -0.25 -0.50 -0.75 -1.00 -N + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +N e f f - -N - - - -N -e -f -f - -N - -0.1 -N -e -f -f - -N - -0.5 -N -e -f -f - -N -> -0.5 + +N + + + +N +e +f +f + +N + +0.1 +N +e +f +f + +N + +0.5 +N +e +f +f + +N +> +0.5 mcmc_neff_hist (default) diff --git a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-missing-levels.svg b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-missing-levels.svg index 17467d2c1..a3a9b2ba7 100644 --- a/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-missing-levels.svg +++ b/tests/testthat/_snaps/mcmc-diagnostics/mcmc-neff-missing-levels.svg @@ -20,74 +20,74 @@ - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - -0 -0.1 -0.25 -0.5 -0.75 -1 -N + + + + + + + + +0 +0.1 +0.25 +0.5 +0.75 +1 +N e f f - -N - - - - - - -N -e -f -f - -N - -0.1 -N -e -f -f - -N - -0.5 -N -e -f -f - -N -> -0.5 + +N + + + + + + +N +e +f +f + +N + +0.1 +N +e +f +f + +N + +0.5 +N +e +f +f + +N +> +0.5 mcmc_neff (missing levels) diff --git a/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-default.svg b/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-default.svg index 4d4c3a36e..45fb70f8d 100644 --- a/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-default.svg +++ b/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-default.svg @@ -242,11 +242,11 @@ -π -E -π -Δ -E +π +E +π +Δ +E mcmc_nuts_energy (default) diff --git a/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-merged.svg b/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-merged.svg index f7eb3bef3..26ce37c8f 100644 --- a/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-merged.svg +++ b/tests/testthat/_snaps/mcmc-nuts/mcmc-nuts-energy-merged.svg @@ -74,10 +74,10 @@ π -E -π -Δ -E +E +π +Δ +E mcmc_nuts_energy (merged) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-default.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-default.svg index 1a4bdfb3f..9fdcc654d 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-default.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-default.svg @@ -72,23 +72,23 @@ 0.2 mean sd -T -= -( -mean -, - -sd -) +T += +( +mean +, + +sd +) -T -( -y -p -r -e -d -) +T +( +y +p +r +e +d +) ppd_stat_2d (default) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-stat-size-alpha.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-stat-size-alpha.svg index 914f1e9a8..9170f5b97 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-stat-size-alpha.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-2d-stat-size-alpha.svg @@ -76,23 +76,23 @@ 0.2 median mad -T -= -( -median -, - -mad -) +T += +( +median +, + +mad +) -T -( -y -p -r -e -d -) +T +( +y +p +r +e +d +) ppd_stat_2d (stat, size, alpha) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-default.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-default.svg index a6c039982..16f1016db 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-default.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-default.svg @@ -56,18 +56,18 @@ 0.1 0.2 0.3 -T -= -mean - -T -( -y -p -r -e -d -) +T += +mean + +T +( +y +p +r +e +d +) ppd_stat (default) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-discrete-stat.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-discrete-stat.svg index d87f232be..4a42b8a79 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-discrete-stat.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-discrete-stat.svg @@ -51,18 +51,18 @@ 0.4 0.5 0.6 -T -= -prop0 - -T -( -y -p -r -e -d -) +T += +prop0 + +T +( +y +p +r +e +d +) ppd_stat (discrete, stat) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-default.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-default.svg index a48bbd943..67de54b58 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-default.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-default.svg @@ -146,18 +146,18 @@ -T -= -mean +T += +mean -T -( -y -p -r -e -d -) +T +( +y +p +r +e +d +) ppd_stat_freqpoly_grouped (default) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-stat-facets-bw.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-stat-facets-bw.svg index 5634658a4..380125c65 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-stat-facets-bw.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-freqpoly-grouped-stat-facets-bw.svg @@ -123,18 +123,18 @@ -T -= -sum +T += +sum -T -( -y -p -r -e -d -) +T +( +y +p +r +e +d +) ppd_stat_freqpoly_grouped (stat, facets, bw) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-default.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-default.svg index f885ae2cd..3aed9cd74 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-default.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-default.svg @@ -209,18 +209,18 @@ -T -= -mean - -T -( -y -p -r -e -d -) +T += +mean + +T +( +y +p +r +e +d +) ppd_stat_grouped (default) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-discrete-stat.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-discrete-stat.svg index 2741e5eb6..e075886fe 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-discrete-stat.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-discrete-stat.svg @@ -93,18 +93,18 @@ 0.5 -T -= -prop0 - -T -( -y -p -r -e -d -) +T += +prop0 + +T +( +y +p +r +e +d +) ppd_stat_grouped (discrete, stat) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-stat-facet-args-binwidth.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-stat-facet-args-binwidth.svg index a17f4351a..d06ddc1c4 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-stat-facet-args-binwidth.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-grouped-stat-facet-args-binwidth.svg @@ -137,18 +137,18 @@ -T -= -stats::var - -T -( -y -p -r -e -d -) +T += +stats::var + +T +( +y +p +r +e +d +) ppd_stat_grouped (stat, facet_args, binwidth) diff --git a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-stat-binwidth-freq.svg b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-stat-binwidth-freq.svg index ebbe2d6ef..fbdcef60d 100644 --- a/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-stat-binwidth-freq.svg +++ b/tests/testthat/_snaps/ppc-test-statistics/ppd-stat-stat-binwidth-freq.svg @@ -58,18 +58,18 @@ 1.1 1.2 1.3 -T -= -mad - -T -( -y -p -r -e -d -) +T += +mad + +T +( +y +p +r +e +d +) ppd_stat (stat, binwidth, freq)