View source: R/choice_identifiers.R
| choice_identifiers | R Documentation |
The choice_identifiers object defines identifiers for the deciders and
choice occasions.
generate_choice_identifiers() generates identifiers.
extract_choice_identifiers() extracts choice identifiers.
choice_identifiers(
data_frame,
format = "wide",
column_decider = "deciderID",
column_occasion = "occasionID",
cross_section = FALSE
)
generate_choice_identifiers(
N = length(Tp),
Tp = 1,
column_decider = "deciderID",
column_occasion = "occasionID"
)
extract_choice_identifiers(
x,
format = attr(x, "format"),
column_decider = attr(x, "column_decider"),
column_occasion = attr(x, "column_occasion"),
cross_section = attr(x, "cross_section")
)
data_frame |
[ |
format |
[ In the long case, unique combinations of |
column_decider |
[ |
column_occasion |
[ |
cross_section |
[ |
N |
[ |
Tp |
[ Can also be of length |
x |
An object of class
|
An object of class choice_identifiers, which is a tibble with columns:
column_decider contains the decider identifiers,
column_occasion contains the choice occasion identifiers (only if
column_occasion is not NULL and cross_section = FALSE).
### panel case
generate_choice_identifiers(N = 2, Tp = 2)
### cross-sectional case
generate_choice_identifiers(N = 5, column_occasion = NULL)
### read choice identifiers
choice_identifiers(
data_frame = travel_mode_choice,
format = "long",
column_decider = "individual",
column_occasion = NULL,
cross_section = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.