Package 'COVIDutilities'

Title: Pulls and Returns Tidy COVID-19 Data
Description: What the package does (one paragraph).
Authors: Tim Essam [aut, cre], Aaron Chafetz [aut], Baboyma Kagniniwa [aut]
Maintainer: Tim Essam <[email protected]>
License: MIT + file LICENSE
Version: 1.1.0
Built: 2024-12-03 04:58:38 UTC
Source: https://github.com/USAID-OHA-SI/COVIDutilities

Help Index


Import Our World in Data Vaccine rates Pull list of countries for which vax data exist

Description

Import Our World in Data Vaccine rates

Usage

get_vax_countries(pepfar_only = TRUE)

Arguments

pepfar_only

pepfar_only limit to just PEPFAR countries, default = TRUE

Value

Returns an object of the countries being tracked by Our World in Data

Source

https://github.com/owid/covid-19-data

See Also

Other vax: pull_vax_data()

Examples

## Not run: 
#all countries
  cntry_list <- get_vax_countries(pepfar_only = FALSE)
  df_vax <- get_vax_data(cntry_list)
#pepfar only countries
  cntry_list <- get_vax_countries()
  df_vax_pepfar <- get_vax_data(cntry_list)

## End(Not run)

Fetch Our World In Data vaccine data

Description

Retrieves COVID-19 vaccination data for a given list of countries

Usage

get_vax_data(cntry)

Arguments

cntry

country, or list of countries, that appear in the our world in data page

Details

Import OWID vaccine data

Value

Returns data frame of total vaccinations by day


PEPFAR COUNTRY ISO CODES

Description

A dataframe containing the PEPFAR country name and its associated ISO Code 3

Usage

pepfar_iso_map

Format

A data frame with 71 rows and 2 variables:

countryname

PEPFAR country name

iso

3 letter ISO code

Source

https://final.datim.org/


Pull HDX COVID Government Measures data

Description

Downloads the UNOCHA HDX COVID Government Measures dataset and loads it into R. The COVID Government Measures dataset "puts together all the measures implemented by governments worldwide in response to the Coronavirus pandemic." For more information, see https://data.humdata.org/dataset/acaps-covid19-government-measures-dataset.

Usage

pull_covid_gov_measures(natl_lvl_only = TRUE, pepfar_only = TRUE)

Arguments

natl_lvl_only

limit data to national level, default = TRUE

pepfar_only

limit to just PEPFAR countries, default = TRUE

Value

dataframe of countries and their types of government interventions by day

Source

https://data.humdata.org/dataset/acaps-covid19-government-measures-dataset

Examples

## Not run: 
df_gov_measures <- pull_covid_gov_measures()
df_restrictions <- df_gov_measures %>% 
  filter(countryname == "Nigeria",
         measure %in% c("Domestic travel restrictions",
                        "Partial lockdown", "Full lockdown",
                        "Checkpoints within the country",
                        "Curfews"),
         log_type == "Introduction / extension of measures") %>% 
  select(countryname, 
         date = date_implemented, 
         restrict_cat = category, 
         restrict_measure = measure) 
## End(Not run)

Pull JHU COVID-19 Case, Recovery, and Death Data

Description

%>% Returns a tidy data frame of JHU COVID-19 data. Returns a tidy data frame with columns for COVID-19 confirmed cases, recoveries and deaths.

Usage

pull_jhu_covid(pepfar_only = TRUE)

Arguments

pepfar_only

limit to just PEPFAR countries, default = TRUE

Source

https://github.com/CSSEGISandData/COVID-19/

Examples

## Not run: 
covid_data <- pull_jhu_covid() 
## End(Not run)

Pull Oxford Stringency Index

Description

API pull of Oxford COVID-19 Government Response Tracker. The stringency index is a composite index across 7 indicators on how governments respond to the COVID epidemic, with scores between 0-100

Usage

pull_stringency_index(
  date_start = "2020-01-22",
  date_end = NULL,
  pepfar_only = TRUE
)

Arguments

date_start

start date for stringency index as yyyy-mm-dd, default/min is Jan 22, 2020

date_end

end date for stringency index as yyyy-mm-dd, default is NULL which will run through today

pepfar_only

limit to just PEPFAR countries, default = TRUE

Details

More info at https://covidtracker.bsg.ox.ac.uk/about-api

Value

dataframe of all PEPFAR countries and their stringency index value by day

Source

https://covidtracker.bsg.ox.ac.uk/about-api

Examples

## Not run: 
df_stringency <- pull_stringency_index(date_end = "2021-04-01") 
## End(Not run)

Fetch Our World In Data vaccine data

Description

Retrieves COVID-19 vaccination data for a given list of countries

Usage

pull_vax_data(cntry)

Arguments

cntry

country, or list of countries, that appear in the our world in data page

Details

Import OWID vaccine data

Value

Returns data frame of total vaccinations by day

Source

https://github.com/owid/covid-19-data

See Also

Other vax: get_vax_countries()

Examples

## Not run: 
#only one country
  df_vax_zmb <- get_vax_data("Zambia")
#only PEPFAR countries
  cntry_list <- get_vax_countries()
  df_vax_pepfar <- get_vax_data(cntry_list)
#all countries
  cntry_list <- get_vax_countries(pepfar_only = FALSE)
  df_vax <- get_vax_data(cntry_list)

## End(Not run)

Returns a dataframe of when WHO declared COVID-19 a pandemic

Description

Returns a dataframe of when WHO declared COVID-19 a pandemic

Usage

who_pandemic()