plot_weekend =
pivot_longer(
holiday_borough_weekend,
bronx:staten_island,
names_to = "borough",
values_to = "persons_injured") %>%
mutate(holiday = fct_reorder(holiday, -total)) %>%
ggplot(aes(x = holiday, y = persons_injured, fill = borough)) +
geom_bar(stat="identity") +
theme(legend.position = "right", axis.text.x = element_text(angle = 45)) +
labs(
title = "Persons Injured by Car Crashs on \n Federal Holidays Weekends (2018)",
x = "Holiday Weekends",
y = "Number Persons Injured") +
scale_fill_discrete(name = "Borough", labels = c("Bronx", "Brooklyn", "Manhattan", "Queens", "Staten Island"))
plot_weekend = ggplotly(plot_weekend)
plot_weekend
plot_day = ggplotly(plot_day)
plot_day
Most persons injured cases happened on Labor Day and Labor Day weekend, while least number of persons injured cases was on Thanksgiving Day. However, Thanksgiving weekend was the second most holiday weekends when most persons are injured. It could be explained by that people tend to stay home on the day of thanksgiving, while most people might be out shopping on Thanksgiving weekend, which increases the number of persons injured.
So try to avoid going out on Labor Day weekend and Thanksgiving week, and be careful if you have to.