pddcs is designed to fetch raw data from different sources and prepare datasets for upload to DCS. Current supported sources are UNICEF, WHO, Eurostat and UN’s Population Division.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github('worldbank/pddcs')

Examples

Fetch a single indicator:

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

Fetch multiple indicators:

# Fetch multiple indicators from the same source
df <- fetch_indicator(
  indicator = c('SH.STA.ANV4.ZS', 'SN.ITK.VITA.ZS'),
  source = 'unicef')

# Fetch multiple indicators from different sources
df <- fetch_indicator(
  indicator = c('SH.STA.ANV4.ZS', 'SP.POP.TOTL'),
  source = c('unicef', 'eurostat'))

Format data:

# Convert to DCS 'data' format 
df <- format_dcs(df, type = 'data')

Write data:

# Write to a DCS formatted file  
write_dcs(df, path = 'data-SP.POP.TOTL-eurostat.xlsx', type = 'data')