Type: Package
Title: Brazilian COVID-19 Pandemic Data
Version: 1.0.0
Description: Set of functions to import COVID-19 pandemic data into R. The Brazilian COVID-19 data, obtained from the official Brazilian repository at https://covid.saude.gov.br/, is available at the country, region, state, and city levels. The package also downloads world-level COVID-19 data from Johns Hopkins University's repository. COVID-19 data is available from the start of follow-up until to May 5, 2023, when the World Health Organization (WHO) declared an end to the Public Health Emergency of International Concern (PHEIC) for COVID-19.
URL: https://fndemarqui.github.io/covid19br/
BugReports: https://github.com/fndemarqui/covid19br/issues
Encoding: UTF-8
License: MIT + file LICENSE
Depends: R (≥ 3.5.0)
Imports: data.table, dplyr, httr2, rlang, sf, tibble, tidyr
Suggests: ggrepel, kableExtra, knitr, leaflet, pracma, plotly, rmarkdown, testthat, tidyverse
LazyData: true
RoxygenNote: 7.3.2
NeedsCompilation: no
Packaged: 2025-08-18 22:01:30 UTC; fndemarqui
Author: Fabio Demarqui [aut, cre, cph], Cristiano Santos [aut], Matheus Costa [ctb]
Maintainer: Fabio Demarqui <fndemarqui@est.ufmg.br>
Repository: CRAN
Date/Publication: 2025-08-18 23:50:45 UTC

Brazilian COVID-19 Pandemic Data.

Description

The package provides a function to automatically import Brazilian CODID-19 pandemic data into R. Brazilian data is available on the country, region, state, and city levels, and are obtained from the official Brazilian repository at <https://covid.saude.gov.br/>. The package also downloads the world-level COVID-19 data from the John Hopkins University's repository at <https://github.com/CSSEGISandData/COVID-19>.

Author(s)

Fábio N. Demarqui, Cristiano C. Santos, and Matheus B. Costa. _PACKAGE


Adding incidence, mortality and lethality rates to the downloaded data

Description

This function adds the incidence, mortality and lethality rates to a given data set downloaded by the covid19br::downloadCovid19() function.

Usage

add_epi_rates(data, ...)

Arguments

data

a data set downloaded using the covid19br::downloadCovid19() function.

...

further arguments passed to other methods.

Details

The function add_epi_rates() was designed to work with the original names of the variables accumDeaths, accummCases and pop available in the data set downloaded by the covid19br::downloadCovid19(). For this reason, this function must be used before any change in such variable names.

Value

the data set with the added incidence, mortality and lethality rates.

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Examples


library(covid19br)
library(dplyr)

brazil <- downloadCovid19(level = "brazil")
brazil <- add_epi_rates(brazil)
glimpse(brazil)



Adding the geometry to the downloaded data for drawing maps

Description

This function adds the necessary geometry for drawing maps to a given data set downloaded by the covid19br::downloadCovid19() function.

Usage

add_geo(data, ...)

Arguments

data

a data set downloaded using the covid19br::downloadCovid19() function.

...

further arguments passed to other methods.

Details

The function add_geo() was designed to work with the original names of the variables available in the dataset downloaded by the covid19br::downloadCovid19(). For this reason, this function must be used before any changes in the original names of the variables.

The development human index (DHI) variables (see full description below) are available at city level, and their average are computed for state and region levels.

Data dictionary (Brazilian data):

Data dictionary (world data):

Value

the data set with the added georeferenced data.

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source

Examples


library(covid19br)
library(dplyr)

regions <- downloadCovid19(level = "regions")
regions_geo <- add_geo(regions)
glimpse(regions_geo)


Function to download COVID-19 data from web repositories

Description

This function downloads the pandemic COVID-19 data at Brazil and World levels. Brazilian data is available at national, region, state, and city levels, whereas the world data are available at the country level.

Usage

downloadCovid19(level = c("brazil", "regions", "states", "cities", "world"))

Arguments

level

the desired level of data aggregation: "brazil" (default), "regions", "states", "cities", and "world".

Details

Data dictionary (variables commum to brazilian and world data):

Data dictionary (variables in the brazilian data):

Data dictionary (variables in the world data):

Value

a tibble containing the downloaded data at the specified level.

Examples


library(covid19br)

# Downloading Brazilian COVID-19 data:
brazil <- downloadCovid19(level = "brazil")
regions <- downloadCovid19(level = "regions")
states <- downloadCovid19(level = "states")
cities <- downloadCovid19(level = "cities")

# Downloading world COVID-19 data:
world <- downloadCovid19(level = "world")



Results of the 2018 presidential election in Brazil by city.

Description

Dataset containing the results of the 2018 presidential election in Brazil.

Format

A data frame with 5570 rows and 6 variables:

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source

Tribunal Superior Eleitoral (TSE). URL: https://www.tse.jus.br/eleicoes/estatisticas.


Results of the 2018 presidential election in Brazil by region.

Description

Dataset containing the results of the 2018 presidential election in Brazil.

Format

A data frame with 5 rows and 4 variables:

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source

Tribunal Superior Eleitoral (TSE). URL: https://www.tse.jus.br/eleicoes/estatisticas.


Results of the 2018 presidential election in Brazil by state.

Description

Dataset containing the results of the 2018 presidential election in Brazil.

Format

A data frame with 27 rows and 5 variables:

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source

Tribunal Superior Eleitoral (TSE). URL: https://www.tse.jus.br/eleicoes/estatisticas.


City-level georeferenced data

Description

Data set obtained from the Instituto Brasileiro de Geografia e Estatística (IBGE) with data on the Brazilian population and geographical information on city level.

Format

A data frame with 5570 rows and 16 variables:

Details

The development human index (DHI) variables are available at city level, and their average are computed for state and region levels.

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source


Region-level georeferenced data

Description

Data set obtained from the Instituto Brasileiro de Geografia e Estatística (IBGE) with data on the Brazilian population and geographical information on region level.

Format

A data frame with 5 rows and 10 variables:

Details

The development human index (DHI) variables are available at city level, and their average are computed for state and region levels.

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source


State-level georeferenced data

Description

Data set obtained from the Instituto Brasileiro de Geografia e Estatística (IBGE) with data on the Brazilian population and geographical information on state level.

Format

A data frame with 27 rows and 12 variables:

Details

The development human index (DHI) variables are available at city level, and their average are computed for state and region levels.

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source


World-level georeferenced data

Description

Data set containing the world population and geographical information on country level.

Format

A data frame with 241 rows and 11 variables:

Author(s)

Fabio N. Demarqui fndemarqui@est.ufmg.br

Source