Learn R Programming

ColOpenData (version 1.0.0)

download_pop_projections: Download population projections

Description

This function downloads population projections and back projections taken from the National Population and Dwelling Census of 2018 (CNPV), adjusted after COVID-19. Available years are different for each spatial level:

  • "national": 1950 - 2070.

  • "national" with sex: 1985 - 2050.

  • "department": 1985 - 2050.

  • "department" with sex: 1985 - 2050.

  • "municipality": 1985 - 2035.

  • "municipality" with sex: 1985 - 2035.

  • "municipality" with sex and ethnic groups: 2018 - 2035.

Usage

download_pop_projections(
  spatial_level,
  start_year,
  end_year,
  include_sex = FALSE,
  include_ethnic = FALSE
)

Value

data.frame object with downloaded data.

Arguments

spatial_level

character with the spatial level to be consulted. Can be either "national", "department" or "municipality".

start_year

numeric with the start year to be consulted.

end_year

numeric with the end year to be consulted.

include_sex

logical for including (or not) division by sex. Default is FALSE.

include_ethnic

logical for including (or not) division by ethnic group (only available for "municipality"). Default is FALSE.

Examples

Run this code
if (FALSE) { # identical(tolower(Sys.getenv("NOT_CRAN")), "true")
pop_proj <- download_pop_projections("national", 2020, 2030)
head(pop_proj)
}

Run the code above in your browser using DataLab