1. Learn
  2. /
  3. Courses
  4. /
  5. Joining Data with dplyr

Exercise

Visualizing questions and answers in tags

In the last exercise, you modified the posts_with_tags table to add a year column, and aggregated by type, year, and tag_name. The modified table has been preloaded for you as by_type_year_tag, and has one observation for each type (question/answer), year, and tag. Let's create a plot to examine the information that the table contains about questions and answers for the dplyr and ggplot2 tags. The ggplot2 package has been preloaded for you.

by_type_year_tag <- posts_with_tags %>%
  mutate(year = year(creation_date)) %>%
  count(type, year, tag_name)

Instructions

100 XP
  • Filter the by_type_year_tag table for the dplyr and ggplot2 tags.
  • Create a line plot with that filtered table that plots the frequency (n) over time, colored by question/answer and faceted by tag.