Package 'covid19br'

Title: Brazilian COVID-19 Pandemic Data
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 country, region, state, and city-levels. The package also downloads the world-level COVID-19 data from the John Hopkins University's repository.
Authors: Fabio Demarqui [aut, cre, cph], Cristiano Santos [aut], Matheus Costa [ctb]
Maintainer: Fabio Demarqui <[email protected]>
License: MIT + file LICENSE
Version: 0.1.8
Built: 2024-10-10 04:45:11 UTC
Source: https://github.com/fndemarqui/covid19br

Help Index


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 [email protected]

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):

  • region: regions' names

  • state: states' names.

  • city: cities' names.

  • DHI: development human index.

  • EDHI: educational development human index.

  • LDHI: longevity development human index.

  • IDHI: income development human index.

  • pop: estimated population in 2019.

  • region_code: numerical code attributed to regions

  • state_code: numerical code attributed to states

  • mesoregion_code: numerical code attributed to mesoregions

  • microregion_code: numerical code attributed to microregions

  • city_code: numerical code attributed to cities

  • geometry: georeferenced data needed to plot maps.

  • area: area (in Km^2)

  • demoDens: demographic density.

Data dictionary (world data):

  • country: country's name

  • continent: continent's name

  • region: regions' names

  • subregion: subregion's name

  • pop: estimated population

  • pais: country's name in Portuguese

  • country_code: numerical code attributed to countries

  • continent_code: numerical code attributed to continents

  • region_code: numerical code attributed to regions

  • subregion_code: numerical code attributed to subregions

  • geometry: georeferenced data needed to plot maps.

Value

the data set with the added georeferenced data.

Author(s)

Fabio N. Demarqui [email protected]

Source

Examples

library(covid19br)
library(dplyr)

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

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.


Function to download COVID-19 data from web repositories

Description

This function downloads the pandemic COVID-19 data at Brazil and World levels. Brazilan 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):

  • date: date of data registry

  • epi_week: epidemiological week

  • pop: estimated population

  • accumCases: accumulative number of confirmed cases

  • newCases: daily count of new confirmed cases

  • accumDeaths: accumulative number of deaths

  • newDeaths: daily count of new deaths

  • newRecovered: daily count of new recovered patients

Data dictionary (variables in the brazilian data):

  • region: regions' names

  • state: states' names.

  • city: cities' names.

  • state_code: numerical code attributed to states

  • city_code: numerical code attributed to cities

  • healthRegion_code: health region code

  • healthRegion: heald region name

  • newFollowup: daily count of new patients under follow up

  • metro_area: indicator variable for city localized in a metropolitan area

  • capital: indicator variable for capital of brazilian states

Data dictionary (variables in the world data):

  • country: countries' names

  • accumRecovered: accumulative number of recovered patients

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:

  • region: regions' names

  • state: states' names.

  • city: cities' names.

  • region_code: numerical code attributed to regions

  • state_code: numerical code attributed to states

  • mesoregion_code: numerical code attributed to mesoregions

  • microregion_code: numerical code attributed to microregions

  • city_code: numerical code attributed to cities

  • Bolsonaro: count of votes obtained by the President-elected Jair Bolosnaro.

  • Haddad: count of votes obtained by the defeated candidate Fernando Haddad.

  • pop: estimated population in 2019.

Author(s)

Fabio N. Demarqui [email protected]

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:

  • region: regions' names.

  • Bolsonaro: count of votes obtained by the President-elected Jair Bolosnaro.

  • Haddad: count of votes obtained by the defeated candidate Fernando Haddad.

  • pop: estimated population in 2019.

Author(s)

Fabio N. Demarqui [email protected]

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:

  • region: regions' names.

  • state: states' names.

  • Bolsonaro: count of votes obtained by the President-elected Jair Bolosnaro.

  • Haddad: count of votes obtained by the defeated candidate Fernando Haddad.

  • pop: estimated population in 2019.

Author(s)

Fabio N. Demarqui [email protected]

Source

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