
Load births data, disaggregated by sex, from 1985 to 2020.
Source:R/get_births.R
get_births_INEGI.Rd
get_births_INEGI
is a function that allows the user to get a
demographic dataset of the number and rate of births based on the given
parameters. This function returns the recorded births by INEGI and allows to
specify the sex.
Usage
get_births_INEGI(
v_state = "National",
v_year = 2010,
v_sex = c("Female", "Male", "Total"),
year_groups = TRUE
)
Arguments
- v_state
Character vector specifying the state(s) that the function will return.
- v_year
Numeric vector that specifies the year(s) to return. Must have numbers between 1985 and 2020. Default is 2021.
- v_sex
Vector selecting sex. Options: Female, Male and Total.
- year_groups
Logical. Specifies whether to aggregate the output by year groups.
Value
A demographic dataset containing the selected year
(group, when year_groups = TRUE
), state, state code (CVE_GEO), sex,
the number of births the proportion of births (in relation to the total
births in that year), and the birth rate.
Examples
get_births_INEGI(v_state = c("Aguascalientes", "Campeche"),
v_year = c(1995, 2005, 2015),
v_sex = "Male",
year_groups = TRUE)
#> # A tibble: 6 x 7
#> year_group state CVE_GEO sex births birth_prop birth_rate
#> <fct> <chr> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 [1995,2005] Aguascalientes 1 Male 142856 0.508 0.0278
#> 2 [1995,2005] Campeche 4 Male 101063 0.505 0.0262
#> 3 (2005,2015] Aguascalientes 1 Male 132207 0.509 0.0225
#> 4 (2005,2015] Campeche 4 Male 93836 0.506 0.0225
#> 5 (2015,Inf] Aguascalientes 1 Male 62873 0.509 0.0184
#> 6 (2015,Inf] Campeche 4 Male 38489 0.508 0.0163
get_births_INEGI(v_state = "National",
v_year = c(1985, 2005, 2015),
v_sex = "Total",
year_groups = FALSE)
#> # A tibble: 3 x 7
#> year state CVE_GEO sex births birth_prop birth_rate
#> <dbl> <chr> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 1985 National 0 Total 2634371 1 0.0350
#> 2 2005 National 0 Total 2567313 1 0.0245
#> 3 2015 National 0 Total 2353555 1 0.0195