Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify argument defaults for density-like plots #131

Open
tjmahr opened this issue Dec 5, 2017 · 1 comment
Open

unify argument defaults for density-like plots #131

tjmahr opened this issue Dec 5, 2017 · 1 comment

Comments

@tjmahr
Copy link
Collaborator

tjmahr commented Dec 5, 2017

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.

@jgabry
Copy link
Member

jgabry commented Dec 19, 2017

Thought I already responded to this but I guess not. Agreed that we should unify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants