Last active
October 22, 2020 16:02
-
-
Save yjunechoe/56913b54f2bfc3c16a9b447f5c156597 to your computer and use it in GitHub Desktop.
1000 tweets from @everycolorbot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://pbs.twimg.com/media/Ek8VZFEVgAAHZM_?format=png&name=4096x4096 | |
colortweets <- rtweet::get_timeline("everycolorbot", 1000) | |
colortweets_df <- colortweets %>% | |
select(created_at, text, favorite_count) %>% | |
mutate( | |
hour = lubridate::hour(created_at), | |
hex = paste0("#", str_extract(text, "(?<=0x).*(?= )")) | |
) | |
colortweets_plot <- colortweets_df %>% | |
arrange(-favorite_count) %>% | |
ggplot(aes(lubridate::hour(created_at), favorite_count, color = hex)) + | |
geom_col(aes(size = favorite_count), position = "dodge") + | |
scale_color_identity() + | |
theme_void() + | |
theme( | |
plot.background = element_rect(fill = "#222222", color = NA), | |
legend.position = 0 | |
) + | |
coord_polar() | |
ggsave("everycolorbot_colors.png", width = 10, height = 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment