Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library("tidyverse")
- library("readxl")
- british_pms <- read_excel("data/british-pms.xlsx")
- view(british_pms)
- british_pms %>%
- count(birth_month, sort = TRUE) %>%
- mutate(birth_month = fct_relevel (birth_month,
- month.name)) %>%
- ggplot()+
- geom_col(aes(x = birth_month,
- y = n))
- british_pms %>%
- count(birth_month, sort = TRUE) %>%
- mutate(birth_month = fct_reorder (birth_month,
- n)) %>%
- ggplot()+
- geom_col(aes(x = birth_month,
- y = n),
- fill = "orange") +
- scale_y_continuous(expand = c(0, 0))+
- coord_flip()
- british_pms %>%
- count(birth_month, sort = TRUE) %>%
- mutate(birth_month = fct_reorder (birth_month,
- n)) %>%
- ggplot()+
- geom_col(aes(x = birth_month,
- y = n),
- fill = "orange") +
- scale_y_continuous(limits = c(0, 9),
- breaks = 1:9,
- expand = expand_scale(mult = c(0,0),
- add = c(0.1,0)))+
- coord_flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement