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

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")
)

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 if IIASA server is down.

Value

A tibble with the data selected.

Details

If not 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
e0Life Expectancy at Birth
cdrCrude Death Rate
assrAge-Specific Survival Ratio
eassrAge-Specific Survival Ratio by Education
netNet Migration

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:

scenariodescription
1Rapid Development (SSP1)
2Medium (SSP2)
3Stalled Development (SSP3)
21Medium - Zero Migration (SSP2 - ZM)
22Medium - Double Migration (SSP2 - DM)

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: 60 × 5
#>    scenario name     country_code period      tfr
#>       <dbl> <chr>           <dbl> <chr>     <dbl>
#>  1        2 Austria            40 1950-1955  2.1 
#>  2        2 Bulgaria          100 1950-1955  2.53
#>  3        2 Austria            40 1955-1960  2.57
#>  4        2 Bulgaria          100 1955-1960  2.3 
#>  5        2 Austria            40 1960-1965  2.78
#>  6        2 Bulgaria          100 1960-1965  2.22
#>  7        2 Austria            40 1965-1970  2.57
#>  8        2 Bulgaria          100 1965-1970  2.13
#>  9        2 Austria            40 1970-1975  2.04
#> 10        2 Bulgaria          100 1970-1975  2.16
#> # … with 50 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: 240 × 6
#>    scenario name                                 country_code sex   period    e0
#>       <dbl> <chr>                                       <dbl> <chr> <chr>  <dbl>
#>  1        1 Viet Nam                                      704 Male  1950-…  50.8
#>  2        1 United Kingdom of Great Britain and…          826 Male  1950-…  66.8
#>  3        1 Viet Nam                                      704 Fema… 1950-…  56.5
#>  4        1 United Kingdom of Great Britain and…          826 Fema… 1950-…  71.9
#>  5        1 Viet Nam                                      704 Male  1955-…  54  
#>  6        1 United Kingdom of Great Britain and…          826 Male  1955-…  67.7
#>  7        1 Viet Nam                                      704 Fema… 1955-…  60.7
#>  8        1 United Kingdom of Great Britain and…          826 Fema… 1955-…  73.4
#>  9        1 Viet Nam                                      704 Male  1960-…  56.8
#> 10        1 United Kingdom of Great Britain and…          826 Male  1960-…  68  
#> # … with 230 more rows

# SSP1 and SSP3 population by education for all countries
get_wcde(scenario = c(1, 3), indicator = "tfr")
#> # A tibble: 13,740 × 5
#>    scenario name                     country_code period      tfr
#>       <dbl> <chr>                           <dbl> <chr>     <dbl>
#>  1        1 Bulgaria                          100 1950-1955  2.53
#>  2        1 Myanmar                           104 1950-1955  6   
#>  3        1 Burundi                           108 1950-1955  6.8 
#>  4        1 Belarus                           112 1950-1955  2.61
#>  5        1 Cambodia                          116 1950-1955  6.95
#>  6        1 Algeria                            12 1950-1955  7.28
#>  7        1 Cameroon                          120 1950-1955  5.49
#>  8        1 Canada                            124 1950-1955  3.64
#>  9        1 Cape Verde                        132 1950-1955  6.57
#> 10        1 Central African Republic          140 1950-1955  5.52
#> # … with 13,730 more rows

# population totals (aggregated over age, sex and education)
get_wcde(indicator = "pop", country_name = "Austria")
#> # A tibble: 31 × 5
#>    scenario name    country_code  year   pop
#>       <dbl> <chr>          <dbl> <dbl> <dbl>
#>  1        2 Austria           40  1950 6936.
#>  2        2 Austria           40  1955 6951.
#>  3        2 Austria           40  1960 7068.
#>  4        2 Austria           40  1965 7302.
#>  5        2 Austria           40  1970 7512.
#>  6        2 Austria           40  1975 7630.
#>  7        2 Austria           40  1980 7599.
#>  8        2 Austria           40  1985 7603.
#>  9        2 Austria           40  1990 7709.
#> 10        2 Austria           40  1995 7975.
#> # … with 21 more rows

# population totals by education group
get_wcde(indicator = "pop", country_name = "Austria", pop_edu = "four")
#> # A tibble: 155 × 6
#>    scenario name    country_code  year education        pop
#>       <dbl> <fct>          <dbl> <dbl> <fct>          <dbl>
#>  1        2 Austria           40  1950 Under 15       1579.
#>  2        2 Austria           40  1950 No Education      0 
#>  3        2 Austria           40  1950 Primary        3027.
#>  4        2 Austria           40  1950 Secondary      2129.
#>  5        2 Austria           40  1950 Post Secondary  201 
#>  6        2 Austria           40  1955 Under 15       1556.
#>  7        2 Austria           40  1955 No Education      0 
#>  8        2 Austria           40  1955 Primary        2882.
#>  9        2 Austria           40  1955 Secondary      2292.
#> 10        2 Austria           40  1955 Post Secondary  220.
#> # … with 145 more rows

# population totals by age-sex group
get_wcde(indicator = "pop", country_name = "Austria", pop_age = "all", pop_sex = "both")
#> # A tibble: 1,302 × 7
#>    scenario name    country_code age    sex    year   pop
#>       <dbl> <chr>          <dbl> <chr>  <chr> <dbl> <dbl>
#>  1        2 Austria           40 0--4   Male   1950  264.
#>  2        2 Austria           40 5--9   Male   1950  285.
#>  3        2 Austria           40 10--14 Male   1950  255.
#>  4        2 Austria           40 15--19 Male   1950  233.
#>  5        2 Austria           40 20--24 Male   1950  242.
#>  6        2 Austria           40 25--29 Male   1950  223.
#>  7        2 Austria           40 30--34 Male   1950  151.
#>  8        2 Austria           40 35--39 Male   1950  220.
#>  9        2 Austria           40 40--44 Male   1950  246 
#> 10        2 Austria           40 45--49 Male   1950  255.
#> # … with 1,292 more rows
# }