# generate historical quarterly outcome
ggplot(table_data,
       aes(x = factor(eval(period_var)),
           fill = simple_outcome)) +
  geom_bar(position = position_fill(reverse = TRUE),
           alpha = 0.8) +
  coord_flip() +
  scale_fill_manual(values = c("#EE0200","#000000")) +
  labs(title = title,
       caption = "Missing values removed from plot",
       fill = "Outcome",
       x = x_label,
       y = "Proportion") + 
  theme(legend.position = "top")


JayAchar/hisreportr documentation built on March 18, 2020, 5:57 a.m.