Skip to content

change bandwidth approach in stat_density2d to match stat_density #2860

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

Closed
kendonB opened this issue Aug 26, 2018 · 2 comments · Fixed by #3419
Closed

change bandwidth approach in stat_density2d to match stat_density #2860

kendonB opened this issue Aug 26, 2018 · 2 comments · Fixed by #3419
Labels
feature a feature request or enhancement layers 📈 tidy-dev-day 🤓 Tidyverse Developer Day

Comments

@kendonB
Copy link

kendonB commented Aug 26, 2018

stat_density currently has the adjust parameter which defaults to 1 and scales whatever the default bandwidth would be. stat_density2d uses h, a length-2 vector which is directly passed to the underlying function in the units of the data.

@paleolimbot paleolimbot added feature a feature request or enhancement layers 📈 labels Jun 7, 2019
@hadley hadley added the tidy-dev-day 🤓 Tidyverse Developer Day label Jun 18, 2019
@hadley
Copy link
Member

hadley commented Jun 18, 2019

I think this is a relatively straightforward fix if you have a little experience with geoms/stats:

  • Add adjust parameter to stat_density_2d() and pass along in params. It would default to c(1, 1)

  • Add adjust parameter to StatDensity2d$compute_group. It would affect the computation of h when it's NULL

@lock
Copy link

lock bot commented Jan 4, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement layers 📈 tidy-dev-day 🤓 Tidyverse Developer Day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants