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

Change default for bw arg of stat_density() and stat_ydensity() #3825

Closed
richierocks opened this issue Feb 18, 2020 · 1 comment · May be fixed by #5854
Closed

Change default for bw arg of stat_density() and stat_ydensity() #3825

richierocks opened this issue Feb 18, 2020 · 1 comment · May be fixed by #5854
Labels
breaking change ☠️ API change likely to affect existing code layers 📈

Comments

@richierocks
Copy link
Contributor

In the ?density help page, the description for the bw argument states:

The default, "nrd0", has remained the default for historical and compatibility reasons, rather than as a general recommendation, where e.g., "SJ" would rather fit, see also Venables and Ripley (2002).

stat_density() and stat_ydensity() use density()'s default of "nrd0". Since ggplot2's philosophy is to provide the "best" default wherever possible, it seems like a good idea to change the default for these functions to bw = "SJ".

I'm not an expert in KDE algorithms, so I can't verify if the claim in the ?density page is true or not, but I thought it worth opening up the discussion.

If you decide to change the default for those functions, it also needs changing in the compute_group() and compute_density() methods of the StatDensity and StatYdensity ggproto objects.

@teunbrand
Copy link
Collaborator

We decided not to change this default.

@teunbrand teunbrand closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ☠️ API change likely to affect existing code layers 📈
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants