Color vs. Facet

Classwork 10

Author

Byeong-Hak Choe

Published

November 4, 2024

Modified

November 17, 2024

NBC Show Data

The nbc_show data is from NBC’s TV pilots:

library(tidyverse)
nbc_show <- read_csv("https://bcdanl.github.io/data/nbc_show.csv")
  • Gross Ratings Points (GRP): estimated total viewership of the show, which measures broadcast marketability.
    • A higher GRP suggests broader exposure and a potentially more marketable show.
  • Projected Engagement (PE): how engaged viewers were after watching a show, a more suitable measure of audience.
    • After watching a show, a viewer is quizzed on order and detail.
    • This measures their engagement with the show (and ads!).
    • High PE values suggest strong engagement.

Q1a

  • Provide ggplot() code to describe the relationship between GRP and PE.

Answer:

ggplot(data = nbc_show,
       mapping = aes(x = GRP,
                     y = PE)) +
  geom_point() +
  geom_smooth()

ggplot(data = nbc_show,
       mapping = aes(x = GRP,
                     y = PE)) +
  geom_point() +
  geom_smooth(method = "lm")


Q1b

  • Provide ggplot() code to describe how the relationship between GRP and PE varies by Genre.

Answer:

ggplot(data = nbc_show,
       mapping = aes(x = GRP,
                     y = PE,
                     color = Genre)) +
  geom_point() +
  geom_smooth(method = "lm",
              se = FALSE)   # se = FALSE turns off the ribbon

ggplot(data = nbc_show,
       mapping = aes(x = GRP,
                     y = PE,
                     color = Genre)) +
  geom_point(show.legend = FALSE) +
  geom_smooth(method = "lm",
              show.legend = FALSE,
              se = FALSE) +  # se = FALSE turns off the ribbon
  facet_wrap(~Genre)


Q1c

  • What are the advantages to using faceting instead of the color aesthetic? What are the disadvantages? How might the balance change if you had a larger dataset?

Answer:

  • Advantages of Faceting
    1. Clarity for Multiple Categories: Faceting avoids the visual clutter of overlapping points and lines, especially when the number of categories (e.g., Genre) is large.
    2. Highlights Individual Patterns: By splitting the data into separate plots, it’s easier to observe specific trends or outliers within each genre.
    3. Improved Readability: Each genre gets its own visual space, avoiding the need to distinguish between multiple colors.
  • Disadvantages of Faceting
    • Difficult Cross-Category Comparison: Observations in separate facets cannot be directly compared. Audiences need to read through all facets.
  • Impact with Larger Dataset
    • More Data Points: Overlapping increases, making faceting a more practical option to reduce clutter. Color aesthetics may struggle to show patterns with dense data points.
    • More Categories: Differentiating between colors becomes harder as the number of categories increases. In such cases, faceting is clearer.
    • Transparency Issues: Using transparency (alpha) with many overlapping points and colors can result in a loss of clear category identification.


Back to top