get_migration: Load migration data

View source: R/get_migration.R

get_migrationR Documentation

Load migration data

Description

get_migration is a function that allows the user to get a demographic dataset regarding migration based on the given parameters.

Usage

get_migration(
  v_state = "National",
  v_year = c(2000, 2010, 2025),
  v_sex = c("Female", "Male", "Total"),
  v_age = c(0, 15, 24, 36),
  v_type = c("Interstate", "International", "Total"),
  age_groups = TRUE
)

Arguments

v_state

State(s) of desired data.

v_year

Year(s) of desired data. Must have numbers between 1970 and 2050.

v_sex

Vector selecting sex. Options: Female, Male and Total.

v_age

Specifies the age bins to aggregate and return.

v_type

Indicates whether type of migration to include. It can be Interstate migration, International migration or Total migration.

age_groups

Specifies whether to aggregate the output by age groups.

Value

A demographic dataset containing the selected year, the state, the state code (CVE_GEO), the age (age group, when age_groups = TRUE), the type of migration, the number of emigrants, the number of immigrants, migration balance (immigrants - emigrants), and the rate of emigration and immigration, respectively.

Examples


get_migration(v_state = c("Yucatan", "Sonora"),
              v_year = 2015,
              v_sex = "Total",
              v_age = c(0, 25, 35, 45),
              v_type = "International",
              age_groups = TRUE)

get_migration(v_state = "Mexico City",
              v_year = c(2000, 2010),
              v_sex = "Female",
              v_age = c(0, 15, 35, 45, 75),
              v_type = c("Interstate", "International", "Total"),
              age_groups = FALSE)


PADeCI/demogmx documentation built on Jan. 27, 2024, 6:43 a.m.