List Option

The List option allows the user to select one value from a predefined set of strings.

Description

In the jamovi UI, a List option is typically represented by a ComboBox (drop-down) or a set of RadioButtons.

YAML Properties

PropertyTypeDescription
namestringThe unique name of the option.
typestringMust be List.
titlestringThe label displayed in the UI.
optionsarrayA list of strings representing the available choices.
defaultstringThe default selected value. If omitted, the first item in options is used.

R Implementation

In R, a List option is represented as a character string.

Examples

1. Define in YAML

- name: hypothesis
  type: List
  title: Hypothesis
  options:
    - greater
    - less
    - unequal
  default: unequal

2. Implementation in R

Access the value using self$options$name:

if (self$options$hypothesis == "greater") {
    # Perform one-tailed test
}