Skip to content

Instantly share code, notes, and snippets.

@JosiahParry
Created December 30, 2019 19:09
Show Gist options
  • Save JosiahParry/b6c9d7ff6ce22440b5c60576696d732a to your computer and use it in GitHub Desktop.
Save JosiahParry/b6c9d7ff6ce22440b5c60576696d732a to your computer and use it in GitHub Desktop.
library(bbcharts)
library(tidyverse)
rock <- decade_end_bb("hot-rock-songs")
real_rock <- c("The Black Keys", "Panic! At The Disco", "Foo Fighters", "Fall Out Boy")
count(rock, artist, sort = TRUE) %>%
filter(n >= 2) %>%
mutate(artist = fct_reorder(artist, n),
`Actual Rock` = ifelse(artist %in% real_rock, "yep", "probably not")) %>%
ggplot(aes(artist, n, fill = `Actual Rock`)) +
geom_col(width = .75) +
coord_flip() +
theme_bari() +
scale_fill_manual(values = c("grey40", "grey85")) +
theme(
legend.position = "bottom"
) +
labs(x = "",
y = "# Songs in Top 50",
subtitle = 'Top "Rock" Artists of the Decade')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment