Learn R Programming

socialmixr (version 0.7.0)

survey_country_population: Get survey country population data

Description

[Deprecated]

This function is deprecated alongside wpp_age(), which it wraps. The underlying wpp2017 data is outdated. Construct a data.frame with columns lower.age.limit and population from a current source (e.g. the wpp2024 package from GitHub) and pass it to contact_matrix() via the survey_pop argument instead.

Usage

survey_country_population(survey, countries = NULL)

Value

A data table with population data by age group for the survey countries, aggregated by lower age limit. The function will error if no country information is available from either the survey or countries argument.

Arguments

survey

A survey() object, with column "country" in "participants".

countries

Optional. A character vector of country names. If specified, this will be used instead of the potential "country" column in "participants".

Examples

Run this code
if (requireNamespace("wpp2017", quietly = TRUE)) {
  survey_country_population(polymod, countries = "Belgium")
}

Run the code above in your browser using DataLab