1. Learn
  2. /
  3. Courses
  4. /
  5. Manipulating Time Series Data in R

Exercise

zoo and ggplot2

zoo objects, much like data frames, can be visualized with functions from the ggplot2 package. While this course doesn't go into too much detail regarding ggplot2 plots and functions, it's nonetheless helpful to review the syntax for more advanced plotting techniques than using autoplot() alone.

In this exercise, you'll explore using zoo and ggplot2 together. You'll take the card_prices time series from the previous exercise and generate a ggplot, complete with proper labels, a title, and a theme!

zoo, ggplot2, and card_prices are available to use.

Instructions

100 XP
  • Within the call to aes(), enter the appropriate mappings to the x and y axes.

  • Plot the time series as a line, with the color in red.

  • Use the light theme from ggplot2

  • Include the axis labels and title: "Index" for the x-axis, "Price (EUR)" for the y-axis, and "Daily Card Prices for Trading Card Game" for the title.