Get policy actions and stringency data from JSON

get_data(json)

Arguments

json

A JSON string, URL or file created using get_json_time() or get_json_actions().

Value

A tibble of time series stringency index data if json is a time series endpoint or a named list of two tibbles (the first tibble is named policyActions and the second tibble is named stringencyData) if json is a policy actions endpoint.

Examples

## Get time series JSON endpoint x <- get_json_time(from = "2020-10-29", to = "2020-10-31") ## Get time series stringency index data get_data(x)
#> # A tibble: 531 x 8 #> date_value country_code confirmed deaths stringency_actu… stringency #> <date> <chr> <int> <int> <dbl> <dbl> #> 1 2020-10-29 ABW 4437 36 37.0 37.0 #> 2 2020-10-29 AFG 41145 1529 5.56 5.56 #> 3 2020-10-29 AGO 9871 271 65.7 65.7 #> 4 2020-10-29 ALB 20040 493 54.6 54.6 #> 5 2020-10-29 AND 4517 72 59.3 59.3 #> 6 2020-10-29 ARE 129024 485 50.9 50.9 #> 7 2020-10-29 ARG 1130520 30071 81.9 81.9 #> 8 2020-10-29 AUS 27554 907 45.8 45.8 #> 9 2020-10-29 AUT 91895 1040 64.8 64.8 #> 10 2020-10-29 AZE 52137 699 64.4 64.4 #> # … with 521 more rows, and 2 more variables: stringency_legacy <dbl>, #> # stringency_legacy_disp <dbl>
## Get policy actions JSON endpoint x <- get_json_actions(ccode = "AFG", from = NULL, to = "2020-07-16") ## Get data on policy actions and stringency index get_data(x)
#> $policyActions #> # A tibble: 18 x 9 #> policy_type_code policy_type_dis… policyvalue policyvalue_act… flagged #> <chr> <chr> <int> <int> <lgl> #> 1 C1 School closing 3 3 TRUE #> 2 C2 Workplace closi… 3 3 FALSE #> 3 C3 Cancel public e… 2 2 TRUE #> 4 C4 Restrictions on… 4 4 TRUE #> 5 C5 Close public tr… 2 2 FALSE #> 6 C6 Stay at home re… 2 2 FALSE #> 7 C7 Restrictions on… 2 2 FALSE #> 8 C8 International t… 1 1 NA #> 9 E1 Income support 0 0 NA #> 10 E2 Debt/contract r… 0 0 NA #> 11 E3 Fiscal measures 0 0 NA #> 12 E4 International s… 0 0 NA #> 13 H1 Public informat… 2 2 TRUE #> 14 H2 Testing policy 1 1 NA #> 15 H3 Contact tracing 1 1 NA #> 16 H4 Emergency inves… 0 0 NA #> 17 H5 Investment in v… 0 0 NA #> 18 H6 Facial Coverings 3 3 TRUE #> # … with 4 more variables: is_general <lgl>, notes <chr>, #> # flag_value_display_field <chr>, policy_value_display_field <chr> #> #> $stringencyData #> # A tibble: 1 x 6 #> date_value country_code confirmed deaths stringency_actual stringency #> <chr> <chr> <int> <int> <dbl> <dbl> #> 1 2020-07-16 AFG 34994 1094 78.7 78.7 #>