Skip to contents

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".

Value

a tibble containing the downloaded data at the specified level.

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

Examples

# \donttest{
library(covid19br)

# Downloading Brazilian COVID-19 data:
brazil <- downloadCovid19(level = "brazil")
#> Downloading COVID-19 data from the official Brazilian repository: https://covid.saude.gov.br/
#> Please, be patient...
#> Done!
regions <- downloadCovid19(level = "regions")
#> Downloading COVID-19 data from the official Brazilian repository: https://covid.saude.gov.br/
#> Please, be patient...
#> Done!
states <- downloadCovid19(level = "states")
#> Downloading COVID-19 data from the official Brazilian repository: https://covid.saude.gov.br/
#> Please, be patient...
#> Done!
cities <- downloadCovid19(level = "cities")
#> Downloading COVID-19 data from the official Brazilian repository: https://covid.saude.gov.br/
#> Please, be patient...
#> Done!

# Downloading world COVID-19 data:
world <- downloadCovid19(level = "world")
#> Downloading COVID-19 data from the Johns Hopkins University's repository
#> Please, be patient...
#> Done!
# }