Download data from the Wittgenstein Centre Human Capital Data Explorer
Source:R/get_wcde.R
get_wcde.Rd
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")
)
Arguments
- indicator
One character string based on the
indicator
column in thewic_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 topop
. Defaults to no age groupstotal
, but can be set toall
.- pop_sex
Character string for population sexes if
indicator
is set topop
. Defaults to no sextotal
, but can be set toboth
orall
.- pop_edu
Character string for population educational attainment if
indicator
is set topop
. Defaults tototal
, but can be set tofour
,six
oreight
.- 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 usegithub
or1&1
if IIASA server is down. Can check availability by setting tosearch-available
.- version
Character string for version of projections to obtain. Defaults to
wcde-v3
, but can usewcde-v2
orwcde-v1
. Scenario and indicator availability vary between versions.
Value
A tibble with the data selected.
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:
indicator | Indicator Description |
pop | Population Size (000's) |
bpop | Population Size by Broad Age (000's) |
epop | Population Size by Education (000's) |
prop | Educational Attainment Distribution |
bprop | Educational Attainment Distribution by Broad Age |
growth | Average Annual Growth Rate |
nirate | Average Annual Rate of Natural Increase |
sexratio | Sex Ratio |
mage | Population Median Age |
tdr | Total Dependency Ratio |
ydr | Youth Dependency Ratio |
odr | Old-age Dependency Ratio |
ryl15 | Age When Remaining Life Expectancy is Below 15 years |
pryl15 | Proportion of Population with a Remaining Life Expectancy below 15 Years |
mys | Mean Years of Schooling by Age |
bmys | Mean Years of Schooling by Broad Age |
ggapmys15 | Gender Gap in Mean Years Schooling (15+) |
ggapmys25 | Gender Gap in Mean Years Schooling (25+) |
ggapedu15 | Gender Gap in Educational Attainment (15+) |
ggapedu25 | Gender Gap in Educational Attainment (25+) |
tfr | Total Fertility Rate |
etfr | Total Fertility Rate by Education |
asfr | Age-Specific Fertility Rate |
easfr | Age-Specific Fertility Rate by Education |
cbr | Crude Birth Rate |
macb | Mean Age at Childbearing |
emacb | Mean Age at Childbearing by Education |
e0 | Life Expectancy at Birth |
cdr | Crude Death Rate |
assr | Age-Specific Survival Ratio |
eassr | Age-Specific Survival Ratio by Education |
net | Net Migration |
netedu | Net Migration Flows by Education |
emi | Emigration Flows |
imm | Immigration 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:
scenario | description | version |
1 | Rapid Development (SSP1) | V1, V2, V3 |
2 | Medium (SSP2) | V1, V2, V3 |
3 | Stalled Development (SSP3) | V1, V2, V3 |
4 | Inequality (SSP4) | V1, V3 |
5 | Conventional Development (SSP5) | V1, V3 |
20 | Medium - Constant Enrollment Rate (SSP2-CER) | V1 |
21 | Medium - Fast Track Education (SSP2-FT) | V1 |
22 | Medium - Zero Migration (SSP2-ZM) | V2, V3 |
23 | Medium - Double Migration (SSP2-DM) | V2, V3 |
See wic_scenarios
data frame for more details.
Examples
# \donttest{
# SSP2 tfr for Austria and Bulgaria
get_wcde(indicator = "tfr", country_code = c(40, 100))
#> # A tibble: 32 × 5
#> scenario name country_code period tfr
#> <dbl> <chr> <dbl> <chr> <dbl>
#> 1 2 Austria 40 2020-2025 1.45
#> 2 2 Bulgaria 100 2020-2025 1.57
#> 3 2 Austria 40 2025-2030 1.48
#> 4 2 Bulgaria 100 2025-2030 1.56
#> 5 2 Austria 40 2030-2035 1.51
#> 6 2 Bulgaria 100 2030-2035 1.59
#> 7 2 Austria 40 2035-2040 1.54
#> 8 2 Bulgaria 100 2035-2040 1.60
#> 9 2 Austria 40 2040-2045 1.57
#> 10 2 Bulgaria 100 2040-2045 1.59
#> # … with 22 more rows
# 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"))
#> # A tibble: 128 × 6
#> scenario name count…¹ sex period e0
#> <dbl> <chr> <dbl> <chr> <chr> <dbl>
#> 1 1 Viet Nam 704 Male 2020-… 71.2
#> 2 1 United Kingdom of Great Britain and Nort… 826 Male 2020-… 80.4
#> 3 1 Viet Nam 704 Fema… 2020-… 80.3
#> 4 1 United Kingdom of Great Britain and Nort… 826 Fema… 2020-… 84.3
#> 5 1 Viet Nam 704 Male 2025-… 73.2
#> 6 1 United Kingdom of Great Britain and Nort… 826 Male 2025-… 82.5
#> 7 1 Viet Nam 704 Fema… 2025-… 82.0
#> 8 1 United Kingdom of Great Britain and Nort… 826 Fema… 2025-… 86.2
#> 9 1 Viet Nam 704 Male 2030-… 75.1
#> 10 1 United Kingdom of Great Britain and Nort… 826 Male 2030-… 84.0
#> # … with 118 more rows, and abbreviated variable name ¹country_code
# SSP1 and SSP3 population by education for all countries
get_wcde(scenario = c(1, 3), indicator = "tfr")
#> # A tibble: 7,296 × 5
#> scenario name country_code period tfr
#> <dbl> <chr> <dbl> <chr> <dbl>
#> 1 1 Bulgaria 100 2020-2025 1.53
#> 2 1 Myanmar 104 2020-2025 1.94
#> 3 1 Burundi 108 2020-2025 4.55
#> 4 1 Belarus 112 2020-2025 1.32
#> 5 1 Cambodia 116 2020-2025 2.13
#> 6 1 Algeria 12 2020-2025 2.76
#> 7 1 Cameroon 120 2020-2025 4.01
#> 8 1 Canada 124 2020-2025 1.37
#> 9 1 Cape Verde 132 2020-2025 1.80
#> 10 1 Central African Republic 140 2020-2025 5.15
#> # … with 7,286 more rows
# population totals (aggregated over age, sex and education)
get_wcde(indicator = "pop", country_name = "Austria")
#> # A tibble: 17 × 5
#> scenario name country_code year pop
#> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 2 Austria 40 2020 8901.
#> 2 2 Austria 40 2025 9045.
#> 3 2 Austria 40 2030 9106.
#> 4 2 Austria 40 2035 9152.
#> 5 2 Austria 40 2040 9190.
#> 6 2 Austria 40 2045 9230.
#> 7 2 Austria 40 2050 9266.
#> 8 2 Austria 40 2055 9281.
#> 9 2 Austria 40 2060 9277.
#> 10 2 Austria 40 2065 9257.
#> 11 2 Austria 40 2070 9234.
#> 12 2 Austria 40 2075 9204.
#> 13 2 Austria 40 2080 9152.
#> 14 2 Austria 40 2085 9073.
#> 15 2 Austria 40 2090 8969.
#> 16 2 Austria 40 2095 8850.
#> 17 2 Austria 40 2100 8721.
# population totals by education group
get_wcde(indicator = "pop", country_name = "Austria", pop_edu = "four")
#> # A tibble: 85 × 6
#> scenario name country_code year education pop
#> <dbl> <fct> <dbl> <dbl> <fct> <dbl>
#> 1 2 Austria 40 2020 Under 15 1283.
#> 2 2 Austria 40 2020 No Education 0.763
#> 3 2 Austria 40 2020 Primary 431.
#> 4 2 Austria 40 2020 Secondary 5052.
#> 5 2 Austria 40 2020 Post Secondary 2134.
#> 6 2 Austria 40 2025 Under 15 1295.
#> 7 2 Austria 40 2025 No Education 3.19
#> 8 2 Austria 40 2025 Primary 343.
#> 9 2 Austria 40 2025 Secondary 5056.
#> 10 2 Austria 40 2025 Post Secondary 2347.
#> # … with 75 more rows
# population totals by age-sex group
get_wcde(indicator = "pop", country_name = "Austria", pop_age = "all", pop_sex = "both")
#> # A tibble: 714 × 7
#> scenario name country_code age sex year pop
#> <dbl> <chr> <dbl> <chr> <chr> <dbl> <dbl>
#> 1 2 Austria 40 0--4 Male 2020 224.
#> 2 2 Austria 40 5--9 Male 2020 219.
#> 3 2 Austria 40 10--14 Male 2020 216.
#> 4 2 Austria 40 15--19 Male 2020 226.
#> 5 2 Austria 40 20--24 Male 2020 266.
#> 6 2 Austria 40 25--29 Male 2020 308.
#> 7 2 Austria 40 30--34 Male 2020 309.
#> 8 2 Austria 40 35--39 Male 2020 307.
#> 9 2 Austria 40 40--44 Male 2020 283.
#> 10 2 Austria 40 45--49 Male 2020 309.
#> # … with 704 more rows
# }