youth <- gun_deaths |>
filter(age <= 65)
Gun deaths
Application exercise
Gun deaths by age
We have data about 100798 individuals killed by guns. Only 15687 are older than 65. The distribution of the remainder is shown below:
Gun deaths by race
youth |>
mutate(race = fct_infreq(race) |> fct_rev()) |>
ggplot(mapping = aes(y = race)) +
geom_bar() +
labs(y = "Victim race")