Clearly some of the really popular national parks (such as Yellow Stone YELL, Yosemite YOSE) have average monthly visits on a entirely different scale than some of the other national parks. To plot seasonal patterns better, we could first calculate the average monthly visits, then “scale” the monthly visits to be percentage of the maximum average monthly visit.
A part of me wants to create a joy plot/ridge line version of this graph but that’s a challenge for later after I figure out how to use OJS with Quarto…
This graph gives a better sense of what are the seasonal variations in visit patterns across national parks. But it also glosses over a lot of details happening over the years. That’s when I thought maybe an animated version of the monthly visit data across the years could be something cool to try out.
Animating things
First, if we were to plot everything out all at once, what would it look like?
df %>%ggplot(aes(x = Month, y = RecreationVisits, color = Year, group = Year)) +geom_line() +facet_wrap(~UnitCode) +scale_x_continuous(breaks =1:12, labels =1:12) +scale_color_viridis_c() +theme_custom()
We can make it animated by using the gganimate package. Let’s first start with a single national park, say Acadia ACAD:
There are a lot of things happening at the same time … What if I want to identify outliers? What if I want to know whether geographically close national parks are going to have similar visitation patterns? This is why I built the interactive version.