bayesplot
bayesplot copied to clipboard
unify argument defaults for density-like plots
This is something I noticed while reviewing ppc_dens_overlay()
. The density defaults were hard-coded for ppc_dens_overlay()
but not for these similar functions.
mcmc_areas <- function(...,
bw = NULL,
adjust = NULL,
kernel = NULL,
n_dens = NULL) {}
mcmc_areas_data <- function(...,
bw = NULL,
adjust = NULL,
kernel = NULL,
n_dens = NULL) {}
mcmc_areas_ridges <- function(...,
bw = NULL,
adjust = NULL,
kernel = NULL,
n_dens = NULL){}
mcmc_areas_ridges_data <- function(...,
bw = NULL,
adjust = NULL,
kernel = NULL,
n_dens = NULL) {}
# this function does all the density calculations for the four above functions
compute_interval_density <- function(x, interval_width = 1, n_dens = 1024,
bw = NULL, adjust = NULL, kernel = NULL) {
n_dens <- n_dens %||% 1024
...
}
We should make this more consistent and update the @template args-density-controls
boilerplate file.
Thought I already responded to this but I guess not. Agreed that we should unify this.