Created
March 24, 2020 23:14
-
-
Save JosiahParry/11fc0ac03a00ded8b55286cf5745201d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# https://github.com/rfordatascience/tidytuesday/tree/master/data/2020/2020-03-24 | |
# Get the Data | |
tbi_age <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-24/tbi_age.csv') | |
tbi_year <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-24/tbi_year.csv') | |
tbi_military <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-24/tbi_military.csv') | |
tbi_military %>% | |
ggplot(aes(diagnosed, severity)) + | |
geom_col() + | |
facet_grid(component ~ service) | |
tbi_age %>% | |
filter(!age_group %in% c("0-17", "Total")) %>% | |
mutate(positions = as.integer(str_extract(age_group, "[0-9]+")), | |
age_group = fct_reorder(age_group, positions)) %>% | |
ggplot(aes(number_est, injury_mechanism)) + | |
geom_col() + | |
facet_wrap(~age_group) + | |
theme_minimal() | |
tbi_age %>% | |
filter(!age_group %in% c("0-17", "Total")) %>% | |
mutate(positions = as.integer(str_extract(age_group, "[0-9]+")), | |
age_group = fct_reorder(age_group, positions), | |
type = fct_rev(fct_relevel(type, c("Emergency Department Visit", "Hospitalizations","Deaths")))) %>% | |
ggplot(aes(rate_est, type)) + | |
geom_col(fill = wesanderson::wes_palettes[["IsleofDogs1"]][[1]]) + | |
facet_wrap(~age_group) + | |
theme_minimal() | |
# https://git.io/JvSmM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment