R in 3 Months Week 11 (Advanced Data Viz, Part 2)

Agenda

  1. Housekeeping

  2. Advanced Custom Themes

  3. Mapping

  4. Interactive Data Viz

  5. Next Week

Housekeeping

  1. Two more weeks: Advanced Quarto and final projects

  2. Final project is to record a video demonstrating something you’ve learned (lesson)

Self-reflection

Please share in the chat:

  1. What was one thing that you’ve found difficult this week?
  2. What was one thing that you’ve learned this week?

Why is group = district needed?

ggplot(
  aes(
    x = year,
    y = pct,
    color = highlight_district,
    group = district
  )
) +
  geom_line()

A. To create one line per district
B. To color the lines
C. To remove missing values
D. To format percentages

Why is group = district needed?

ggplot(
  aes(
    x = year,
    y = pct,
    color = highlight_district,
    group = district
  )
) +
  geom_line()

A. To create one line per district
B. To color the lines
C. To remove missing values
D. To format percentages

Advanced Custom Themes

Organizations with Public Custom {ggplot2} Themes

Organizations with Public Custom {ggplot2} Themes, Continued

Mapping

Check-in break

ggplot() +
  geom_sf(
    data = portland_boundaries,
    fill = "gray80"
  ) +
  geom_sf(
    data = traffic_signals,
    aes(color = software_type),
    size = 1
  )
  1. Which layer will appear underneath the other?
  2. What geometry type is traffic_signals likely using?
  3. What will determine the color of the traffic signal points?

Interactive Data Viz

Next Week

  • Advanced Quarto

  • Do the lessons relevant to you (chat with Gracielle if you’d like help identifying them) and skip the rest

  • I’ll demonstrate parameterized reporting next week in the live session so feel free to skip those lessons for now

  • Start to think about final project