calculate_index: Calculate an OxCGRT index or indices

Description Usage Arguments Value Author(s) Examples

View source: R/calculate_index.R

Description

Calculate an OxCGRT index or indices

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

df

A data.frame produced by a call to calculate_subindices().

codes

A vector of policy type codes to use for the index calculation.

tolerance

An integer specifying the number of missing values above which index will not be calculated and reported.

Value

A numeric value for mean subindex scores of specified policy types. For calculate_indices(), a tibble calculated OxCGRT indices

Author(s)

Ernest Guevarra

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Get policy actions data for Afghanistan on 1 September 2020
x <- get_data(json = get_json_actions(ccode = "AFG",
                                      from = NULL,
                                      to = "2020-09-01"))

## Calculate OxCGRT subindices
y <- calculate_subindices(df = x$policyActions)

## Calculate OxCGRT index
calculate_index(df = y,
                codes = c(paste("C", 1:8, sep = ""),
                          paste("E", 1:2, sep = ""),
                          paste("H", 1:3, sep = ""), "H6"),
                tolerance = 1)

## Calculate OxCGRT government response index
calculate_gov_response(df = y)

## Calculate OxCGRT containment and health index
calculate_containment_health(df = y)

## Calculate OxCGRT stringency index
calculate_stringency(df = y)

## Calculate OxCGRT economic support index
calculate_economic_support(df = y)

## Calculate all OxCGRT indices
calculate_indices(df = y)

oxcgrt documentation built on Nov. 27, 2020, 5:07 p.m.