swirldev / swirl_courses

:mortar_board: A collection of interactive courses for the swirl R package.
http://swirlstats.com
Other
4.29k stars 7.25k forks source link

wording of the colour order needs reversing #474

Open stevee-bee opened 3 years ago

stevee-bee commented 3 years ago

Course: Exploratory Data Analysis Lesson: GGPlot2 Part1 Progress: 61%

Issue: I believe the order of the wording should flipped to blue on the bottom, then green, then red on top. So something like this:

Blue (if rear wheel drv is in the bin) is at the bottom of the bin, then green on top of it (if present), followed by red (4-wheel drv).

> qplot(hwy, data = mpg, fill = drv)

| You nailed it! Good job!

  |==============================                    |  61%
| See how qplot consistently uses the colors. Red (if
| 4-wheel drv is in the bin) is at the bottom of the bin,
| then green on top of it (if present), followed by blue
| (rear wheel drv). The color lets us see right away that
| 4-wheel drive vehicles in this dataset don't have gas
| mileages exceeding 30 miles per gallon.

mpg-hwy-drv-hist

Thanks, Steve

stevee-bee commented 3 years ago

It looks like the order of fill may have been reversed in the ggplot2 package. I'm using v3.3.3. (Or maybe the factor order of cut in the diamonds dataset has been reversed. But given that this also occurred with drv in the mpg dataset in the original post on this thread, I'm guessing this is not the case.)

Course: Exploratory Data Analysis Lesson: GGPlot2 Extras Progress: 26%

Issue: The order referenced in the Swirl lesson ("...fair cut diamonds are at the bottom...") is the opposite to the order generated by the corresponding reference plot where fair cut diamonds are at the top.

> qplot(price, data = diamonds, binwidth = 18497/30, fill = cut)

| Great job!

  |===========                               |  26%
| This shows how the counts within each price
| grouping (bin) are distributed among the
| different cuts of diamonds. Notice how qplot
| displays these distributions relative to the cut
| legend on the right. The fair cut diamonds are at
| the bottom of each bin, the good cuts are above
| them, then the very good above them, until the
| ideal cuts are at the top of each bin. You can
| quickly see from this display that there are very
| few fair cut diamonds priced above $5000.

qplot-diamond-price-cut