knitr::opts_chunk$set( collapse = TRUE, comment = "#>", echo=FALSE, warning=FALSE, message=FALSE, fig.height=8, fig.width=10 )
library(covid19br) library(tidyverse) library(covid19br) library(geobr) library(cowplot) library(knitr) library(DT)
<<<<<<< HEAD
=======
b2a7b6663c72754fab7d2d008d9f207794b602f9
library(tidyverse) library(ggrepel) library(covid19br) # Filter os países que deseja paises <- c("Brazil", "Peru", "Argentina", "Colombia", "Equador", "Bolivia", "Venezuela", "Paraguay", "Ecuador", "Uruguay", "Chile", "Guyana", "Suriname") max_date <- covid_global$date %>% max() g1 <- ggplot(covid_global %>% filter(state %in% paises & date > "2020-02-23"), aes(y = confirmed_cases, x = date, color = state)) + geom_line(size = 2, alpha = .5, show.legend = FALSE) + geom_point(show.legend = FALSE, size = 1, alpha = .5) + geom_label_repel(data = covid_global %>% filter(state %in% paises & date == max_date), aes(y = confirmed_cases, x = date, color = state, label = state), show.legend = FALSE) + #scale_y_log10(labels = c("1", "100", "1 mil", "10 mil", "100 mil"), breaks = c(1, 100, 1000, 10000, 100000)) + scale_x_date(date_breaks = "3 days", date_labels = "%d %b") + theme_classic(base_size = 18) + labs(y = "Casos confirmados (covid-19) [log10]", x = "Data", title = "covid-19 | América do Sul", caption = "Fonte: Our World in Data | Atualizado: 2020-03-23") g1
library(tidyverse) library(ggrepel) library(covid19br) # Filter os países que deseja paises <- c("Brazil", "Peru", "Argentina", "Colombia", "Equador", "Bolivia", "Venezuela", "Paraguay", "Ecuador", "Uruguay", "Chile", "Guyana", "Suriname") max_date <- covid_global$date %>% max() g2 <- ggplot(covid_global %>% filter(state %in% paises & date > "2020-02-23"), aes(y = confirmed_cases, x = date, color = state)) + geom_line(size = 2, alpha = .5, show.legend = FALSE) + geom_point(show.legend = FALSE, size = 1, alpha = .5) + geom_label_repel(data = covid_global %>% filter(state %in% paises & date == max_date), aes(y = confirmed_cases, x = date, color = state, label = state), show.legend = FALSE) + scale_y_log10(labels = c("1", "100", "1 mil", "10 mil", "100 mil"), breaks = c(1, 100, 1000, 10000, 100000)) + scale_x_date(date_breaks = "3 days", date_labels = "%d %b") + theme_classic(base_size = 18) + labs(y = "Casos confirmados (covid-19) [log10]", x = "Data", title = "covid-19 | América do Sul", caption = "Fonte: Our World in Data | Atualizado: 2020-03-23") g2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.