Guest User

Untitled

a guest
Feb 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. library(epidata) # install.packages("epidata")
  2. library(hrbrthemes) # install.packages("hrbrthemes")
  3. library(tidyverse)
  4.  
  5. xdf <- get_median_and_mean_wages("l")
  6.  
  7. select(xdf, -median, -average) %>%
  8. gather(measure, value, -date) %>%
  9. mutate(measure = str_replace_all(measure, "_", " ")) %>%
  10. mutate(measure = str_to_title(measure)) %>%
  11. mutate(date = as.Date(sprintf("%s-01-01", date))) %>%
  12. ggplot(aes(date, value)) +
  13. ggalt::stat_xspline(geom="area", fill="lightslategray", color="lightslategray", size=3/4, alpha=2/3) +
  14. scale_y_continuous(expand=c(0,0), labels=scales::dollar, limits=c(0,20)) +
  15. facet_wrap(~measure, scales="free_y") +
  16. labs(
  17. x=NULL, y="Hourly wage (USD)",
  18. title="Hourly wage, entry-level positions (college/high school graduate)",
  19. subtitle="Adjusted for inflation (values in 2016 dollars)",
  20. caption='Citation: "Economic Policy Institute"'
  21. ) +
  22. theme_ipsum_rc(grid="XY")
Add Comment
Please, Sign In to add comment