This vignette provides details on the source data retrieved from UNPD.

About the source

fetch_indicator() with source = 'who' retrieves data from a series of online Excel sheets from World Population Prospects 2019 provided by UN’s Population Division.

Both Estimate and Medium variants are retrieved. Data values for the years 2020 - 2050 are estimates.

The use of Excel sheets as source data is likely to change when a new UN API is released.

Available indicators

Currently the following indicators are available for UNPD.

library(dplyr)
data(indicatorlist)
indicatorlist %>% 
  filter(source == 'unpd') %>% 
  select(indicator)
##           indicator
## 1       SP.POP.TOTL
## 2    SP.DYN.TFRT.IN
## 3 SP.POP.AG00.MA.IN

Note that the code SP.POP.AG00.MA.IN is an exception to how fetch_indicator() usually works. Using indicator = 'SP.POP.AG00.MA.IN' will return data for all population groups from 0 - 25 years (i.e SP.POP.AG00.MA.IN - SP.POP.AG25.MA.IN).

Examples

# Fetch population data from UNPD
df <- fetch_indicator('SP.POP.TOTL', source = 'unpd')

# Fetch male population data for all age groups  (0 - 25)
df <- fetch_indicator('SP.POP.AG00.MA.IN', source = 'unpd')

References

UN. World Population Prospects 2019. https://population.un.org/wpp/