-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
90 lines (66 loc) · 2.96 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
88
89
---
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%"
)
```
# semaforos
<!-- badges: start -->
[![Lifecycle:
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Codecov test
coverage](https://codecov.io/gh/Bisaloo/semaforos/branch/main/graph/badge.svg)](https://codecov.io/gh/Bisaloo/semaforos?branch=main)
[![R-CMD-check](https://github.com/Bisaloo/semaforos/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Bisaloo/semaforos/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
![](https://bisaloo.github.io/semaforos/articles/semaforos_files/figure-html/maps-ggplot-1.png)
The semaforos R package provides easy access to historical data of [**Semáforos
Epidemiológicos**, which are part of the COVID-19 response strategy of
Mexico](https://coronavirus.gob.mx/semaforo/). The **Semáforos** define 4
degrees of alert at the State level and are re-evaluated weekly.
*El paquete de R semaforos proporciona un facil acceso a los datos historicos de
los [**Semáforos Epidemiológicos**, los cuales forman parte de la estrategia de
respuesta del Gobierno Mexicano contra la pandemia del
COVID-19](https://coronavirus.gob.mx/semaforo/). Los **Semáforos** poseen 4
grados de alerta que se aplican a cada Estado por una semana.*
![Explanation of the different levels](man/figures/semaforos_explanation.png)
## Installation
You can install the development version of this package from GitHub:
*Puedes instalar la ultima version de este paquete desde GitHub:*
```{r eval = FALSE}
remotes::install_github("Bisaloo/semaforos")
```
**The data can also be directly used by downloading the [csv
file](https://github.com/Bisaloo/semaforos/blob/main/inst/extdata/semaforos.csv)**.
*Tambien puedes descargar los datos directamente desde
[aqui](https://github.com/Bisaloo/semaforos/blob/main/inst/extdata/semaforos.csv).*
## Usage
```{r}
library(semaforos)
```
```{r}
sw <- semaforos_get(format = "wide")
head(sw)
```
```{r}
sl <- semaforos_get(format = "long")
head(sl)
```
## Data source
The data is
[scraped](https://raw.githubusercontent.com/Bisaloo/semaforos/main/data-raw/semaforos.R)
[weekly](https://raw.githubusercontent.com/Bisaloo/semaforos/main/.github/workflows/cron.yml)
from [the Mexican federal government
website](https://datos.covid-19.conacyt.mx/#SemaFE) using the
[httr](https://httr.r-lib.org/) and the [xml2](https://xml2.r-lib.org/)
packages.
*Los datos son
[extraidos](https://raw.githubusercontent.com/Bisaloo/semaforos/main/data-raw/semaforos.R)[semanalmente](https://raw.githubusercontent.com/Bisaloo/semaforos/main/.github/workflows/cron.yml)
desde [el sitio web del gobierno
Mexicano](https://datos.covid-19.conacyt.mx/#SemaFE) con los paquetes
[httr](https://httr.r-lib.org/) y [xml2](https://xml2.r-lib.org/).*