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

Make gentler intro for ggplot2 lesson #552

Open
wants to merge 1 commit into
base: master
from

Conversation

@wallacelab
Copy link

commented Aug 14, 2019

This is in response to Issue #542. The current ggplot2 lesson starts very abruptly and can be confusing to novices. In my teaching, I've found that using a little time to explain the logic of ggplot a bit more helps a lot. I've also found that building up the first graphic piece by piece works better than starting with the finished graphic and then backtracking to explain how it fits together.

All changes in this pull request are in the first section of the lesson (up to but not including the first challenge). There are two main (and separate) changes that have been made:

  1. The introduction to ggplot grammar has been expanded to replace "coordinate system" with "mapping aesthetics" and explain in (slightly) more detail what each component is.
  2. The example scatterplot is built up one element at a time (first data, then aesthetics, then geom) rather than all at once.

In my experience these changes make it much easier for learners to understand how ggplot works. The major disadvantage is that it probably adds ~5 minutes of instruction time.

Inkscape.

Let's start off with an example:
built from the same set of components: a **data set**,

This comment has been minimized.

Copy link
@wallacelab

wallacelab Aug 15, 2019

Author

Change #1: Expand the explanation of how ggplot works to make it easier for novices to understand. Also replaced "coordinate system" with "mapping aesthetics" for the following reasons (from issue #542)

  • The word "coordinate" is never used again in the lesson, whereas "mapping" shows up 25 times and "aesthetic" 16 times
  • None of the examples actually change the coordinate system. (The closest is adjusting the scale with + scale_x_log10() )
  • The base ggplot() command seems to function more like a "layer 0" than a coordinate system. (This may be due to an incorrect mental map on my part, but it behaves like the base layer on which everything else is placed.)
  • This would make clearer what aes() is actually doing (mentioned briefly in issue #473)
important aspects of the plot. The idea of layers of graphics may
be familiar to you if you have used image editing programs
like Photoshop, Illustrator, or Inkscape.

This comment has been minimized.

Copy link
@wallacelab

wallacelab Aug 15, 2019

Author

Second major change (below): Broke the first example apart so that it's built up in stages (data, aesthetics, geoms) rather than putting in a large block of code all at once. In my experience this helps learners understand better what each component is doing and how they fit together.

@@ -334,11 +348,11 @@ elements. The x-axis is too cluttered, and the y axis should read
"Life expectancy", rather than the column name in the data frame.

This comment has been minimized.

Copy link
@wallacelab

wallacelab Aug 15, 2019

Author

Not sure how the below edits happened since they didn't show up in my initial comparison. Regardless, they're just spaces at the end of the line and can be ignored.

@jcoliver

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

Thanks for the PR, @wallacelab . We're reviewing the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.