Skip to contents

One verb, many providers. Whatever the source, the result comes back on the ISO spine: iso3c, year where the data is a panel, and one column per indicator.

Usage

fetch_indicator(source, indicator, countries = NULL, years = NULL, ...)

Arguments

source

A registered source name (see country_sources()).

indicator

Indicator code(s). Name the vector to rename the columns, as in world_data(): c(gdp = "NY.GDP.PCAP.KD").

countries

Optional iso3c vector; NULL (default) for all.

years

Optional numeric year vector; NULL for the provider's default.

...

Passed to the source's own fetch function.

Value

A tibble keyed on iso3c (and year, for a panel).

Examples

if (FALSE) { # \dontrun{
fetch_indicator("wdi", c(gdp = "NY.GDP.PCAP.KD"), years = 2020)
fetch_indicator("owid", "life_expectancy", years = 2020)
} # }