-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
87 lines (62 loc) · 2.85 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# coronavirusbrazil
<!-- badges: start -->
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![GitHub commit](https://img.shields.io/github/last-commit/mralbu/coronavirusbrazil)](https://github.com/mralbu/coronavirusbrazil/commit/master)
<!-- badges: end -->
The coronavirusbrazil package provides a tidy format dataset of the 2019 Novel Coronavirus COVID-19 (2019-nCoV) epidemic for Brazil. The datasets were obtained from [RamiKrispin/coronavirus](https://github.com/RamiKrispin/coronavirus), [Ministerio da Saúde](https://covid.saude.gov.br/), [brasil.io](https://brasil.io/dataset/covid19/caso) and [Secretaria de Saúde - RJ](http://painel.saude.rj.gov.br/monitoramento/covid19.html).
This repository was inspired by the [RamiKrispin/coronavirus](https://github.com/RamiKrispin/coronavirus) package repository.
## Installation
You can install the released version of coronavirusbrazil from [CRAN](https://CRAN.R-project.org) with:
``` r
# install.packages("devtools")
devtools::install_github("mralbu/coronavirusbrazil")
```
## Usage
The package contains the following datasets:
```{r example}
library(coronavirusbrazil)
library(ggplot2)
data("coronavirus_br")
head(coronavirus_br)
```
```{r, warning=FALSE, message=FALSE}
plot_coronavirus(coronavirus_br, xaxis = "date", yaxis = "cases", log_scale = F, linear_smooth = F)
```
```{r, warning=FALSE, message=FALSE}
data("coronavirus_br_states")
head(coronavirus_br_states)
```
```{r, warning=FALSE, message=FALSE}
plot_coronavirus(coronavirus_br_states, yaxis = "percent_case_increase", color = "state", filter_variable = "state", facet = "state", filter_values = c("RJ", "SP", "DF", "CE", "RS", "MG"), log_scale = TRUE, linear_smooth = TRUE)
```
```{r}
data("coronavirus_br_cities")
head(coronavirus_br_cities)
```
There are also geospatial datasets avaiable:
```{r}
dplyr::glimpse(spatial_br_states)
ggplot2::ggplot(spatial_br_states, ggplot2::aes(color=cases, size=cases)) + ggplot2::geom_sf()
```
```{r, message=FALSE, warning=FALSE}
dplyr::glimpse(spatial_br_cities)
ggplot2::ggplot(spatial_br_cities, ggplot2::aes(color=cases, size=cases)) + ggplot2::geom_sf()
```
# Data Sources
- Countries: [RamiKrispin/coronavirus](https://github.com/RamiKrispin/coronavirus)
- States: [Ministerio da Saúde](https://covid.saude.gov.br/)
- Cities: [brasil.io](https://brasil.io/dataset/covid19/caso)
- Rio de Janeiro: [Secretaria de Saúde - RJ](http://painel.saude.rj.gov.br/monitoramento/covid19.html)