library(tidyverse)
setwd("images")
df <- read_csv("country_data.csv")
df %>% mutate(type = cut(fh_polity2, breaks=c(0, 3, 7, 10),
labels=c("Autocracy", "Anocracy", "Democracy"))) %>%
drop_na(type) %>% ggplot(aes(y=wdi_afp, x=mad_gdppc)) +
geom_smooth(method="lm", color='black') +
geom_point(color='orangered3') + facet_wrap(~type) +
scale_x_log10(labels=scales::label_dollar()) +
theme_minimal() + theme(strip.text=element_text(size=20)) +
labs(y="Percent of Labor\nForce in Military",
x="GDP per Capita\n(Log scale)")