4141# ' }
4242# ' \item{`ppc_ecdf_overlay()`, `ppc_dens_overlay()`,
4343# ' `ppc_ecdf_overlay_grouped()`, `ppc_dens_overlay_grouped()`}{
44- # ' Kernel density or empirical CDF estimates of each dataset (row) in
45- # ' `yrep` are overlaid, with the distribution of `y` itself on top
46- # ' (and in a darker shade). When using `ppc_ecdf_overlay()` with discrete
47- # ' data, set the `discrete` argument to `TRUE` for better results.
48- # ' For an example of `ppc_dens_overlay()` also see Gabry et al. (2019).
44+ # ' Kernel density or empirical CDF estimates of each dataset (row) in `yrep`
45+ # ' are overlaid, with the distribution of `y` itself on top (and in a darker
46+ # ' shade). For an example of `ppc_dens_overlay()` also see Gabry et al.
47+ # ' (2019).
4948# ' }
5049# ' \item{`ppc_violin_grouped()`}{
5150# ' The density estimate of `yrep` within each level of a grouping
8584# '
8685# ' ppc_dens_overlay(y, yrep[1:25, ])
8786# ' \donttest{
88- # ' # ppc_ecdf_overlay with continuous data (set discrete=TRUE if discrete data)
87+ # ' # ppc_ecdf_overlay
8988# ' ppc_ecdf_overlay(y, yrep[sample(nrow(yrep), 25), ])
9089# '
9190# ' # PIT-ECDF and PIT-ECDF difference plot of the PIT values of y compared to
@@ -258,20 +257,28 @@ ppc_dens_overlay_grouped <- function(y,
258257
259258# ' @export
260259# ' @rdname PPC-distributions
261- # ' @param discrete For `ppc_ecdf_overlay()`, should the data be treated as
262- # ' discrete? The default is `FALSE`, in which case `geom="line"` is
263- # ' passed to [ggplot2::stat_ecdf()]. If `discrete` is set to
264- # ' `TRUE` then `geom="step"` is used.
260+ # ' @param discrete `r lifecycle::badge("deprecated")` The `discrete` argument is
261+ # ' deprecated. The ECDF is a step function by definition, so `geom_step()` is
262+ # ' now always used.
265263# ' @param pad A logical scalar passed to [ggplot2::stat_ecdf()].
266264# '
267265ppc_ecdf_overlay <- function (y ,
268266 yrep ,
269267 ... ,
270- discrete = FALSE ,
268+ discrete = deprecated() ,
271269 pad = TRUE ,
272270 size = 0.25 ,
273271 alpha = 0.7 ) {
274272 check_ignored_arguments(... )
273+
274+ if (is_present(discrete )) {
275+ deprecate_warn(
276+ " 1.16.0" ,
277+ " ppc_ecdf_overlay(discrete)" ,
278+ details = " The ECDF is now always plotted as a step function."
279+ )
280+ }
281+
275282 data <- ppc_data(y , yrep )
276283
277284 ggplot(data ) +
@@ -291,15 +298,15 @@ ppc_ecdf_overlay <- function(y,
291298 stat_ecdf(
292299 data = function (x ) dplyr :: filter(x , ! .data $ is_y ),
293300 mapping = aes(group = .data $ rep_id , color = " yrep" ),
294- geom = if ( discrete ) " step" else " line " ,
301+ geom = " step" ,
295302 linewidth = size ,
296303 alpha = alpha ,
297304 pad = pad
298305 ) +
299306 stat_ecdf(
300307 data = function (x ) dplyr :: filter(x , .data $ is_y ),
301308 mapping = aes(color = " y" ),
302- geom = if ( discrete ) " step" else " line " ,
309+ geom = " step" ,
303310 linewidth = 1 ,
304311 pad = pad
305312 ) +
@@ -316,17 +323,24 @@ ppc_ecdf_overlay_grouped <- function(y,
316323 yrep ,
317324 group ,
318325 ... ,
319- discrete = FALSE ,
326+ discrete = deprecated() ,
320327 pad = TRUE ,
321328 size = 0.25 ,
322329 alpha = 0.7 ) {
323330 check_ignored_arguments(... )
324331
332+ if (is_present(discrete )) {
333+ deprecate_warn(
334+ " 1.16.0" ,
335+ " ppc_ecdf_overlay_grouped(discrete)" ,
336+ details = " The ECDF is now always plotted as a step function."
337+ )
338+ }
339+
325340 p_overlay <- ppc_ecdf_overlay(
326341 y = y ,
327342 yrep = yrep ,
328343 ... ,
329- discrete = discrete ,
330344 pad = pad ,
331345 size = size ,
332346 alpha = alpha
0 commit comments