Module 10 assignment
Nathan’s Hot Dog Eating Contest
A base R bar chart showing the number of hot dogs eaten each year with new records in dark red.
ggplot2 for the same data:
A more polished ggplot2 bar chart that automatically includes a legend and modern styling.
Stacked Bar Plot:
Part 2: Time Series Visualization Using the Economics Dataset
The economics dataset comes preloaded in ggplot2 and provides U.S. economic data over time.
A simple line plot showing unemployment rate trends over time.
We can also visualize the median unemployment duration and compare it to unemployment rate:
And add color by year to make trends more visible
Visualization plays a major role in understanding time series data. It allows us to:
-
Quickly identify trends, patterns, and seasonal variations.
-
Spot anomalies or turning points in data.
-
Compare multiple variables over time.
-
Communicate findings clearly to others.
Using ggplot2 makes it easier to produce clear, professional-quality time series plots. The ability to add layers, colors, and annotations helps us explore and interpret data more effectively.
Comments
Post a Comment