Package 'semaforos'

Title: Get Semáforo Epidemiológico Data from Mexico COVID-19 Response
Description: Provides Semáforo Epidemiológico data. The Semáforos are a response measure implemented by the Mexican federal government during the COVID-19 pandemic to mitigate to virus propagation. They are graduated across 4 colors (verde, amarillo, naranja, rojo) that indicate increasing levels of urgency and restrictions. Each Semáforo is defined for a given State for a period of one week before being re-evaluated in the light of new epidemiological data. Proporciona datos de los Semáforos Epidemiológicos. Los Semáforos Epidemiológicos son una medida de respuesta por parte del Gobierno Mexicano durante la pandemia del COVID-19 para mitigar la propagacion del virus. Se clasifican en cuatro colores (verde, amarillo, naranja, rojo) que indican un aumento en los niveles de urgencia y restricciones. Los Semáforos Epidemiológicos se definen para cada Estado, y son actualizados semanalmente.
Authors: Hugo Gruson [aut, cre, cph]
Maintainer: Hugo Gruson <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-09-13 02:54:18 UTC
Source: https://github.com/bisaloo/semaforos

Help Index


Get Semáforo Epidemiológico Data from Mexico COVID-19 Response

Description

Get Semáforo Epidemiológico Data from Mexico COVID-19 Response

Usage

semaforos_get(format = c("long", "wide"))

Arguments

format

Either "long" (the default), or "wide" to specify the format of the output data.frame

Value

  • if format = "long", a data.frame with 4 columns:

    • estado which contains the name of the state to which the semaforo in the row applies

    • year the four-digit year (⁠%Y⁠ in strptime())

    • week the two-digit week, as specified in the ISO8601 (⁠%W⁠ in strptime()

    • color the color of the semaforo, indicating the alert level

  • if format = "wide", a data.frame with estado as the first column and then one column for each week, with the column names indicating the week in the format ⁠%Y-W%W⁠ (e.g., "2021-W02")

Examples

sw <- semaforos_get(format = "wide")
head(sw)

sl <- semaforos_get(format = "long")
head(sl)