-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Improve clarity of docstring for ggplot() #5132
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
Improve clarity of docstring for ggplot() #5132
Conversation
kevinxperese
commented
Jan 5, 2023
- changed "component" to "components"
- used "pattern" instead of "way" and "method"
- broke each pattern description in to separate paragraph used more explicit names in example code
- used more explicit data frame and variable names in example code
- added more explicit comments in example code
- removed error bars in last pattern of example code (and removed standard deviations from the summary stats calculated)
changed "component" to "components" used "pattern" instead of "way" and "method" broke each pattern description in to separate paragraph used more explicit names in example code added more explicit comments in example code removed error bars in last pattern of example code (and removed standard deviations from the summary stats calculated)
* Move closing parentheses in example code for aes() * Remove trailing } accidentally left behind
Moving the closing parens was a mistake.
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.
Thanks, I appreciate the effort!
However, there are some issues with the examples for which I've left suggestions. I apologise if they're nit-picky. If you have any questions, please feel free to ask.
Changes per conversation with @teunbrand re: PR tidyverse#5132
Come to think of it, there is also a 4th pattern that is useful in some circumstances. That is to put a partial mapping in ggplot(mapping = aes(x = group)) +
geom_point(mapping = aes(y = value), data = sample_df) +
geom_point(
mapping = aes(y = group_mean), data = group_means_df,
colour = 'red', size = 3
) I'm not convinced it should be in the docs though. |
* wrap long lines in example code * Use consistent phrasing in comments across the three examples
I think I agree.
I don't know what the threshold is for "common," though. (My brain went down the rabbit hole of wanting to actually attempt to quantify the distribution of these four patterns!) |
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.
Thanks for all your efforts is clarifying these patterns!
I think there is GitHub magic to automatically propagate these changes to the manual pages, but in case that fails: could I ask you to run devtools::document()
?
/document
Thanks so much, @teunbrand, for iterating on this with me -- I very much appreciate ALL your work on this project!!! |
No thank you for contributing: I think the patterns are much clearer now, so that will be helpful for people who're trying to learn ggplot2! |