Created
March 17, 2020 23:25
-
-
Save jtrecenti/9ed617e060c2b01cfe9cce32577bf9b5 to your computer and use it in GitHub Desktop.
Ler dados do novo corona virus a partir da base disponibilizada pelo Ministério da Saúde
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
library(magrittr) | |
dados <- "http://plataforma.saude.gov.br/novocoronavirus/resources/scripts/database.js" %>% | |
readr::read_file() %>% | |
stringr::str_remove("var database=") %>% | |
jsonlite::fromJSON() %>% | |
purrr::pluck("brazil") %>% | |
dplyr::mutate(values = purrr::map(values, dplyr::mutate_all, as.character)) %>% | |
tidyr::unnest(values) %>% | |
dplyr::mutate(date = lubridate::dmy(date)) | |
dplyr::glimpse(dados) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment