I replicated a code to plot 7-day moving average of currently hospitalized people in every state.
This is my code:
covus %>%
filter(measure == "hospitalized_currently", state %in% unique(state_pops$state)) %>%
group_by(state) %>%
mutate(hospitalized7 = slider::slide_dbl(count, mean, .before = 7, .after = 0, na.rm = TRUE)) %>%
left_join(state_pops) %>%
ggplot(mapping = aes(x = date, y = (hospitalized7/pop)*1e5)) +
geom_line(size = 0.5) +
scale_y_continuous(labels = scales::comma_format(accuracy = 1)) +
facet_wrap(~ name, ncol = 4) +
labs(x = "Date",
y = "Hospitalized per 100,000 Population (Seven Day Rolling Average)")
As you can see any curve is readable.
So I thought that 7-day moving average is not in my plot. Is there a way to know that? In addition, Can you give me any suggestion to make my curves readable?