Expands the vector of choice variables to a tibble with dummy columns for whether an alternative was chosen. The function uses the sorted unique values of the choice variable to infer the total number of alternatives available (irrespective of whether any of them were chosen)
expand_choices(db, str_id, str_ct, str_choice)
A data.frame or tibble
A character string giving the name of the individual id variable
A character string giving the name of the choice task variable
A character string giving the name of the choice variable
A tibble with the expanded choice variable