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,
  vintage = 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.

vintage

For source = "wdi", the release of the World Development Indicators to read; see world_data(). Other sources have no releases to pin and refuse it.

...

Passed to the source's own fetch function.

Value

A tibble keyed on iso3c (and year, for a panel), with a record of where each indicator column came from; see source_info().

Examples

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