COVID-19 Latam
Anilisis de los datos reportados por Johns Hopkins University (JHU CSSE) y WHO sitreps.
Datos paquete covid19viz de Andree Valle
Informacion Adicional Gobierno del Peru
Situacion Nivel Mundial Coronavirus COVID-19 Global Cases by the Center for Systems Science and Engineering (CSSE)
Datos y grafico
#devtools::install_github("avallecam/covid19viz")
#devtools::install_github('cttobin/ggthemr')
library(colorspace)
library(ggthemr)
paises <- c("Peru", "Brazil", "Colombia", "Ecuador", "Chile", "Argentina", "Uruguay", "Paraguay", "Bolivia")
library(JLutils)
library(rio)
library(lubridate)
library(tidyverse)
dat <- rio::import("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv") %>%
filter(`Country/Region` %in% paises) %>%
gather(dates,cases,-`Province/State`,-`Country/Region`,-Lat,-Long) %>%
filter(cases>0) %>%
group_by(`Country/Region`) %>%
mutate(dates = mdy(dates),
start = first(dates),
d_start = as.numeric(dates-start),
per = ifelse(`Country/Region` =="Peru","Per","Otros"),
max_cases = max(cases)) %>%
filter(max_cases>30)
ggthemr('dust')
dat %>%
filter(per =="Otros") %>%
ggplot(aes(x = d_start, y = cases, group=`Country/Region`)) +
geom_line(aes(col = `Country/Region`)) +
geom_point(aes(col = `Country/Region`, shape = `Country/Region`)) +
geom_text(data = dat %>% slice(n()) %>% filter(`Country/Region`!="Peru"),
aes(y = cases, label = `Country/Region`, col = `Country/Region`), vjust=-.5, show.legend = F) +
geom_line(dat = dat %>% filter(per=="Per"), col = "red") +
geom_point(dat = dat %>% filter(per=="Per"), col = "red") +
geom_text(data = dat %>% slice(n()) %>% filter(`Country/Region`=="Peru"),
aes(y = cases, label = `Country/Region`), col = "red", vjust=-.5, show.legend = F) +
scale_color_discrete_sequential(palette = "Teal", nmax = 14, order = 5:14) +
labs(color = "Paises", x = "Dias desde primer reporte", y = "Numero de casos", shape = "Paises",
title = paste0("Actualizado hasta: ", max(dat$dates))) +
scale_y_log10() +
theme(legend.position = "bottom")