Description Usage Arguments Value Examples
Gathers a population projection matrix and converts it into a tidy data frame with labels for projection year, age and gender groups.
1 2 3 |
proj_mat |
Matrix of population projection results. Columns represent projection years, rows represent age and gender groups. If composed of both male and female groups, female population projections should be in the top half of the matrix. |
year0 |
Numeric value for the base year of the population projection. |
steps |
Numeric value for step size of the population projection. |
age_lab |
Vector containing a character string of age group labels. The length of |
gender_lab |
Vector containing a character string of gender group labels. The length of |
year_col |
Character string for the name of the year labels column. |
age_col |
Character string for the name of the age labels column. |
gender_col |
Character string for the name of the gender labels column. |
pop_col |
Character string for the name of the projected population counts column. |
denom |
Numeric value of a demominator to divide the population size of each age-gender group by. |
A tibble containing four columns. The first three contain information on the year, age and gender of the projection population. The fourth contain information in the projected population sizes or each year-age-gender combination.
1 2 3 4 5 6 7 8 9 10 | df0 <- sweden1993
# matrix output
pp <- fccp_closed0(n = 5, x = df0$x, p = 5, Nx = df0$Nx_f,
sx = df0$sx_f, fx = df0$fx, sn = df0$Lx_f[1]/(5*100000),
tidy_output = FALSE)
pp
tidy_pp(proj_mat = pp, year0 = 1993, steps = 5,
age_lab = df0$age, gender_lab = "Female")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.