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-11-09 04:39:10 UTC |
Source: | https://github.com/fndemarqui/covid19br |
This function adds the incidence, mortality and lethality rates to a given data set downloaded by the covid19br::downloadCovid19() function.
add_epi_rates(data, ...)
add_epi_rates(data, ...)
data |
a data set downloaded using the covid19br::downloadCovid19() function. |
... |
further arguments passed to other methods. |
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.
the data set with the added incidence, mortality and lethality rates.
Fabio N. Demarqui [email protected]
library(covid19br) library(dplyr) brazil <- downloadCovid19(level = "brazil") brazil <- add_epi_rates(brazil) glimpse(brazil)
library(covid19br) library(dplyr) brazil <- downloadCovid19(level = "brazil") brazil <- add_epi_rates(brazil) glimpse(brazil)
This function adds the necessary geometry for drawing maps to a given data set downloaded by the covid19br::downloadCovid19() function.
add_geo(data, ...)
add_geo(data, ...)
data |
a data set downloaded using the covid19br::downloadCovid19() function. |
... |
further arguments passed to other methods. |
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.
the data set with the added georeferenced data.
Fabio N. Demarqui [email protected]
World map: https://CRAN.R-project.org/package=rnaturalearthdata
Shapefiles for Brazilian maps: https://www.ibge.gov.br/geociencias/downloads-geociencias.html
Brazilian DHI data: https://www.ipea.gov.br/ipeageo/bases.html
library(covid19br) library(dplyr) regions <- downloadCovid19(level = "regions") regions_geo <- add_geo(regions) glimpse(regions_geo)
library(covid19br) library(dplyr) regions <- downloadCovid19(level = "regions") regions_geo <- add_geo(regions) glimpse(regions_geo)
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>.
Fábio N. Demarqui, Cristiano C. Santos, and Matheus B. Costa.
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.
downloadCovid19(level = c("brazil", "regions", "states", "cities", "world"))
downloadCovid19(level = c("brazil", "regions", "states", "cities", "world"))
level |
the desired level of data aggregation: "brazil" (default), "regions", "states", "cities", and "world". |
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
a tibble containing the downloaded data at the specified level.
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")
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")
Dataset containing the results of the 2018 presidential election in Brazil.
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.
Fabio N. Demarqui [email protected]
Tribunal Superior Eleitoral (TSE). URL: https://www.tse.jus.br/eleicoes/estatisticas.
Dataset containing the results of the 2018 presidential election in Brazil.
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.
Fabio N. Demarqui [email protected]
Tribunal Superior Eleitoral (TSE). URL: https://www.tse.jus.br/eleicoes/estatisticas.
Dataset containing the results of the 2018 presidential election in Brazil.
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.
Fabio N. Demarqui [email protected]
Tribunal Superior Eleitoral (TSE). URL: https://www.tse.jus.br/eleicoes/estatisticas.