Skip to contents

The model may only answer one of these; the answer comes back as a factor with them as its levels, in this order. Name a level to say what it means: the model reads it.

Usage

choice(...)

Arguments

...

The answers: strings, character vectors, or a factor (its levels). Named, level = "what it means".

Value

A field.

Examples

choice("shipping", "billing", "product", "account")
#> <functai field> one of shipping, billing, product, account
choice(levels(refunds$state))
#> <functai field> one of unopened, opened_unused, used, damaged, wrong_item, faulty
choice(
  approve = "the rules allow a refund",
  deny    = "they do not",
  review  = "a person should decide")
#> <functai field> one of:  # approve: the rules allow a refund; deny: they do not; review: a person should decide