-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Updates to include count & density to fix the use of geom_hexbin #1688
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
Conversation
… ..density.. or ..count.. #1608
@@ -31,6 +31,8 @@ hexBinSummarise <- function(x, y, z, binwidth, fun = mean, fun.args = list(), dr | |||
|
|||
# Convert to data frame | |||
out <- as.data.frame(hexbin::hcell2xy(hb)) | |||
out$count = as.vector(hb@count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use <-
instead of =
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I'm not sure that the code should go here - it's only needed for hexbin, not the other summary functions.
Can you please also add:
|
Replaced `=` with `<-` on added lines.
# Via GitHub * 'master' of github.com:mikebirdgeneau/ggplot2: Update hexbin.R Update NEWS
I've made the requested changes to the best of my ability (still new to pull requests and contributions to third party repos).
As for your comment regarding if this is the right place for the code, that was why I didn't submit a pull request in the first place on #1608 - I thought there might have been an architectural reason for the change that I wasn't familiar enough with to make the fix. Happy to help if this is useful, otherwise I'm equally happy if someone else has a better or more elegant way to resolve this. Cheers! |
Can you move the code to Otherwise looks great! |
Done. I've moved the code to To confirm this did indeed resolve #1608 (in addition to the successful unit test), I ran the code in #1608 and here's the result, which looks good. DF <- data.frame(x=rnorm(1000), y=rnorm(1000))
ggplot(DF) + geom_hex(aes(x=x, y=y, fill=..density..)) |
@@ -7,6 +7,9 @@ ggplot2 1.0.1 | |||
* Improvements to order of colours and legend display for continuous colour | |||
scales extracted from colorbrewer palettes by `scale_*_distiller()` (@jiho, 1076) | |||
|
|||
* Restore functionality for use of `..density..` in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go at the top of NEWS.md
(just underneath the version number heading)
Nearly there - thanks for all the hard work! |
@@ -2,6 +2,9 @@ | |||
ggplot2 1.0.1 | |||
---------------------------------------------------------------- | |||
|
|||
* Restore functionality for use of `..density..` in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still the wrong file - needs to be in NEWS.md
Thanks! |
No problem - thanks for your patience! (Appreciate you taking the time to 'teach' when it could be faster to simply resolve yourself.) |
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/ |
Updates to include count & density to fix the use of geom_hexbin with ..density.. or ..count..
Fixes #1608.