Skip to content

Conversation

kevinxperese
Copy link
Contributor

  • 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.
Copy link
Collaborator

@teunbrand teunbrand left a 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.

@teunbrand
Copy link
Collaborator

teunbrand commented Jan 10, 2023

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() and complete it in the layers, e.g.:

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
@kevinxperese
Copy link
Contributor Author

I'm not convinced it should be in the docs though.

I think I agree.
The description for ggplot() has:

There are three common patterns used to invoke ggplot()

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!)

Copy link
Collaborator

@teunbrand teunbrand left a 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

@kevinxperese
Copy link
Contributor Author

Thanks so much, @teunbrand, for iterating on this with me -- I very much appreciate ALL your work on this project!!!

@teunbrand
Copy link
Collaborator

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!

@teunbrand teunbrand merged commit 2c5a78c into tidyverse:main Jan 15, 2023
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

Successfully merging this pull request may close these issues.

3 participants