Skip to contents

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.

Usage

get_names(names, n_sib = 0, id = TRUE, parents = TRUE)

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.

Value

A vector containing the names for each family member.

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"