get_data: Extract Human Development Index Data

Description Usage Arguments Value Author(s) Examples

View source: R/get_data.R

Description

Fetch data from the UNDP Human Development Report #' Fetch data from the UNDP Human Development Report

Usage

1
get_data(indicator = NULL, country = NULL, year = NULL)

Arguments

indicator

Numerical or character vector with the indicator id (see details)

country

Character vector

year

Numerical vector (see details for which years are available)

The function fetches data from the United Nations Development Programme Human Development Report API.

A dimension can be left as NULL (the default) to get all data for that dimension. The package includes a data frame (hdr_indicators) with the IDs and human-readable names of the indicators.

If the year parameter is not left as NULL, it must be on of the following: 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2011, 2012, 2013.

Value

A data frame

Author(s)

Dhafer Malouche

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Get the Human Development Index for Germany in 2013
df <- get_data(indicator = 137506, country = "TUN", year = 2013)
head(df)

# Leave a dimension as NULL (default) to get all values for that dimension
# e.g. all countries and all year for a specific indicator:
df <- get_data(103606)
head(df)

#' @import  dplyr
#' @export

malouche/hdi documentation built on Sept. 29, 2020, 12:50 a.m.