Learn R Programming

wcde (version 0.0.7)

get_wcde: Download data from the Wittgenstein Centre Human Capital Data Explorer

Description

Downloads data from the Wittgenstein Centre Human Capital Data Explorer. Requires a working internet connection.

Usage

get_wcde(
  indicator = "pop",
  scenario = 2,
  country_code = NULL,
  country_name = NULL,
  pop_age = c("total", "all"),
  pop_sex = c("total", "both", "all"),
  pop_edu = c("total", "four", "six", "eight"),
  include_scenario_names = FALSE,
  server = c("iiasa", "github", "1&1", "search-available", "iiasa-local"),
  version = c("wcde-v3", "wcde-v2", "wcde-v1")
)

Value

A tibble with the data selected.

Arguments

indicator

One character string based on the indicator column in the wic_indicators data frame, representing the variable to be downloaded.

scenario

Vector of length one or more with numbers corresponding the scenarios. See details for more information. Defaults to 2 for the SSP2 Medium scenario.

country_code

Vector of length one or more of country numeric codes based on ISO 3 digit numeric values.

country_name

Vector of length one or more of country names. The corresponding country code will be guessed using the countrycodes package.

pop_age

Character string for population age groups if indicator is set to pop. Defaults to no age groups total, but can be set to all.

pop_sex

Character string for population sexes if indicatoris set to pop. Defaults to no sex total, but can be set to both or all.

pop_edu

Character string for population educational attainment if indicator is set to pop. Defaults to total, but can be set to four, six or eight.

include_scenario_names

Logical vector of length one to indicate if to include additional columns for scenario names and short names. FALSE by default.

server

Character string for server to download from. Defaults to iiasa, but can use github or 1&1 if IIASA server is down. Can check availability by setting to search-available.

version

Character string for version of projections to obtain. Defaults to wcde-v3, but can use wcde-v2 or wcde-v1. Scenario and indicator availability vary between versions.

Details

If no country_name or country_code is provided data for all countries and regions are downloaded. A full list of available countries and regions can be found in the wic_locations data frame.

indicator must be set to a value in the first column in the table below of available demographic indicators:

indicatorIndicator Description
popPopulation Size (000's)
bpopPopulation Size by Broad Age (000's)
epopPopulation Size by Education (000's)
propEducational Attainment Distribution
bpropEducational Attainment Distribution by Broad Age
growthAverage Annual Growth Rate
nirateAverage Annual Rate of Natural Increase
sexratioSex Ratio
magePopulation Median Age
tdrTotal Dependency Ratio
ydrYouth Dependency Ratio
odrOld-age Dependency Ratio
ryl15Age When Remaining Life Expectancy is Below 15 years
pryl15Proportion of Population with a Remaining Life Expectancy below 15 Years
mysMean Years of Schooling by Age
bmysMean Years of Schooling by Broad Age
ggapmys15Gender Gap in Mean Years Schooling (15+)
ggapmys25Gender Gap in Mean Years Schooling (25+)
ggapedu15Gender Gap in Educational Attainment (15+)
ggapedu25Gender Gap in Educational Attainment (25+)
tfrTotal Fertility Rate
etfrTotal Fertility Rate by Education
asfrAge-Specific Fertility Rate
easfrAge-Specific Fertility Rate by Education
cbrCrude Birth Rate
macbMean Age at Childbearing
emacbMean Age at Childbearing by Education
e0Life Expectancy at Birth
cdrCrude Death Rate
assrAge-Specific Survival Ratio
eassrAge-Specific Survival Ratio by Education
netNet Migration
neteduNet Migration Flows by Education
emiEmigration Flows
immImmigration Flows

See wic_indicators data frame for more details.

scenario must be set to one or values in the first column table below of the available future scenarios:

scenariodescriptionversion
1Rapid Development (SSP1)V1, V2, V3
2Medium (SSP2)V1, V2, V3
3Stalled Development (SSP3)V1, V2, V3
4Inequality (SSP4)V1, V3
5Conventional Development (SSP5)V1, V3
20Medium - Constant Enrollment Rate (SSP2-CER)V1
21Medium - Fast Track Education (SSP2-FT)V1
22Medium - Zero Migration (SSP2-ZM)V2, V3
23Medium - Double Migration (SSP2-DM)V2, V3

See wic_scenarios data frame for more details.

Examples

Run this code
# \donttest{
# SSP2 tfr for Austria and Bulgaria
get_wcde(indicator = "tfr", country_code = c(40, 100))

# SSP1 and SSP2 life expectancy for Vietnam and United Kingdom (guessing the country codes)
get_wcde(scenario = c(1, 2), indicator = "e0", country_name = c("Vietnam", "UK"))

# SSP1 and SSP3 population by education for all countries
get_wcde(scenario = c(1, 3), indicator = "tfr")

# population totals (aggregated over age, sex and education)
get_wcde(indicator = "pop", country_name = "Austria")

# population totals by education group
get_wcde(indicator = "pop", country_name = "Austria", pop_edu = "four")

# population totals by age-sex group
get_wcde(indicator = "pop", country_name = "Austria", pop_age = "all", pop_sex = "both")
# }

Run the code above in your browser using DataLab