Variables Option

The Variables option allows the user to select multiple variables (columns) from the dataset.

Description

In the jamovi UI, a Variables option is represented as a Target Drop Box that accepts multiple items. Users can drag several variables into this slot. It is ideal for multivariate analyses, repeated measures, or specifying multiple covariates.

YAML Properties

PropertyTypeDescription
namestringThe unique name of the option.
typestringMust be Variables.
titlestringThe label displayed in the UI.
suggestedarrayA list of suggested variable types.
permittedarrayA list of permitted variable types.
rejectInfbooleanIf true, errors on infinite values. Defaults to true.
rejectMissingbooleanIf true, errors on missing values. Defaults to false.

R Implementation

In R, a Variables option is represented as a character vector. If no variables are assigned, it returns an empty character vector (character(0)).

Examples

1. Define in YAML

- name: deps
  type: Variables
  title: Dependent Variables
  permitted:
    - continuous

2. Implementation in R

Access the list of variables using self$options$name:

depNames <- self$options$deps

for (depName in depNames) {
    # Perform analysis for each variable
}