Adds a postfix to given names for each family member
get_names.Rd
This function serves as a help for the user to generate the wished columns names. The function works well in combination with dplyr using the argument contains in select. There is no requirements for input other than it's a string.
Arguments
- names
Names of the the values to add a postfix to e.g. l_g.
- n_sib
Amount of siblings.
- id
If TRUE add a postfix for the subject.
- parents
If TRUE add postfix for parents.
Examples
get_names(c("l_g", "l_e"), n_sib = 2)
#> [1] "l_g_0" "l_e_0" "l_g_p1" "l_e_p1" "l_g_p2" "l_e_p2" "l_g_s3" "l_e_s3"
#> [9] "l_g_s4" "l_e_s4"