load_covid: Load Covid-19 Data

View source: R/load_covid.R

load_covidR Documentation

Load Covid-19 Data

Description

This function pulls Covid-19 data up to a certain date, for a specified country (and state, if country_name = "Brazil").The output of this function is in the correct format to be used directly into the model adjustment function pandemic_model included in this package.

Usage

load_covid(country_name, state_name = NULL, last_date)

Arguments

country_name

string specifying the country of interest. Check country_list() for the list of countries available in the database.

state_name

optional string specifying the state of interest - only brazilian states currently available in the database. state_name should be either NULL or a string of length 2. Check state_list() for the state abbreviations that will be used and the corresponding state names.

last_date

optional date, character or factor argument specifying the last date in the data. It should be in the YYYY-MM-DD or YYYY/MM/DD format. The default is the most recent date available in the database.

Details

The current version of this function uses the covid19br package to retrieve the data. Be aware that the country names might have been altered between different package versions. Check country_list() for the updated list of country_name options.

Value

An object of S3 class pandemicData. It is a list with 3 items:

data:

data frame with the number of cumulative cases, new cases, cumulative deaths and new deaths associated with Covid-19 for each date, up to the last_date in the specified region.

name:

string with the country name (and state name, if available).

population:

numeric object that contains the population size of the given region.

References

CovidLP Team, 2020. CovidLP: Short and Long-term Prediction for COVID-19. Departamento de Estatistica. UFMG, Brazil. URL: http://est.ufmg.br/covidlp/home/en/

See Also

country_list, state_list, pandemic_model, posterior_predict.pandemicEstimated, pandemic_stats and plot.pandemicPredicted.

Examples

## Not run: 
load_covid("Brazil","MG")
load_covid(country_name = "India", last_date = "2020-06-15")
load_covid("United States of America")
load_covid(country_name = "italy")
## End(Not run)


PandemicLP documentation built on March 18, 2022, 6:22 p.m.