Created
May 6, 2020 10:33
-
-
Save ikashnitsky/878b204e90c25e173ac69b839a383d0f to your computer and use it in GitHub Desktop.
Andrew Noymer's US death tolls gut-check estimates published daily on Twitter
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
#=============================================================================== | |
# 2020-05-06 -- twitter | |
# Andrew Noymer's update of the total US covid deaths | |
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com | |
#=============================================================================== | |
library(rtweet) | |
library(httr) | |
library(tidyverse) | |
library(hrbrthemes) | |
library(ggdark) | |
options(scipen = 9999) | |
raw <- get_timeline(user = "AndrewNoymer", n = 3200) | |
est <- raw %>% | |
filter(text %>% str_detect("gut-check"), | |
text %>% str_detect("VERY")) %>% | |
transmute( | |
created_at, | |
estimate = text %>% | |
str_sub(-52, -1) %>% | |
str_remove_all(",") %>% | |
str_extract("(\\d)+") %>% | |
as.numeric() | |
) | |
est %>% | |
ggplot(aes(created_at, estimate))+ | |
geom_path()+ | |
geom_point()+ | |
scale_y_comma(limits = c(0, 1.4e6))+ | |
dark_theme_minimal(base_family = font_rc)+ | |
labs(x = NULL, y = "Estimate", | |
title = "Andrew Noymer's US death tolls gut-check estimate") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment