Internal helper to create a group variable as base for a density matrix
Source:R/plot_densityMatrix.R
create_groupVariable.Rd
Internal helper function to create a group variable based on the
categorization of either age, period or cohort. To be called from within
plot_densityMatrix
.
Arguments
- dat
Dataset with a column
"age"
,"period"
or"cohort"
, dependent on the specifiedAPC_var
.- APC_var
One of
c("age","period","cohort")
.- groups_list
A list with each element specifying the borders of one row or column in the density matrix. E.g., if the period should be visualized in decade columns from 1980 to 2009, specify
groups_list = list(c(1980,1989), c(1990,1999), c(2000,2009))
. The list can be named to specify labels for the categories.