Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.62 KB | None | 0 0
  1. by_common_jobs <- family %>%
  2.   group_by(Household.Head.Occupation) %>% filter(!Household.Head.Occupation == "NA") %>%
  3.   dplyr::summarise_at(vars(Total.Household.Income), funs(mean(., na.rm = TRUE)))  %>%
  4.   head(20) %>% ungroup()
  5. by_common_jobs
  6. ggplot(by_common_jobs, aes(x=reorder(Household.Head.Occupation, Total.Household.Income), Total.Household.Income)) +
  7.   geom_bar(fill = "#3288BD", stat = "identity") + geom_text(aes(x = Household.Head.Occupation,
  8.   y = 1, label = paste0("(",Total.Household.Income,")",sep="")), hjust=0, vjust=.5, size = 4, colour = 'black', fontface = 'italic') + bluetheme + coord_flip() + xlab("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement