Ask a question with named choices
Arguments
- instructions
A string: the question to decide.
- choices
A named character vector with at least 2 unique names. Each name is an allowed answer (it can contain spaces, such as
"not sure"). Each value describes the answer. In the output ofdecide(), the probability column of an answer has a syntactic name (.pred_not_surefor"not sure"), so two names that give the same column ("not sure"and"not_sure") are refused.
See also
question_noul() for true or false, question_score() for ordered levels, and decide() to ask the question.
Other questions:
question_noul(),
question_score()
Examples
question_choice(
"Which describes the part?",
c(normal = "A clean part.", defective = "A visible defect.")
)
#> <decisions::question_choice> Which describes the part?
#> * normal: A clean part.
#> * defective: A visible defect.