createCtrlList: Create a List to Control the Flow through Experiment

Description Usage Arguments Value

View source: R/create_ctrl_list.R

Description

Create a list of reactive values (see reactiveValues or https://shiny.rstudio.com/reference/shiny/latest/reactiveValues.html) with important variables needed to go through an experiment. Additional variables can be specified.

Usage

1
2
3
4
5
6
7
8
9
createCtrlList(
  firstPage,
  globIds,
  complCode = FALSE,
  complName = NULL,
  oVars = NULL,
  oVarVals = NULL,
  task = NULL
)

Arguments

firstPage

string. The id of the first page to be displayed

globIds

string. A vector containing the ids of the different pages to be displayed (such as instructions or questionnaires but not tasks). Only pages that have a list either created by createPageList or are in the same form have to be indicated here. A hardcoded single page has not to be indicated here.

complCode

logical. If TRUE (default is FALSE) a completion code will be created and complName should be specified.

complName

string. Will be the beginning of the completion code. The completion code will be in the form "complName-XXX-XXX-XXX" where XXX is a randomly drawn number between 100 and 999. This code can then be displayed to the participant that he can enter e.g. as code on Amazon MTurk.

oVars

string. Vector with the name(s) of additional variables that should be added to ctrlList.

oVarVals

sting or numeric. Vector containing the values that should be appended to the oVars variables. Must be the same length as oVars.

task

string. Vector with names indicating which task will be played in the app. Valid inputs are: "bandit", "bart" "dfe", "dfd" or "dd" or any combination of these. For each given task the respective variables necessary will be appended.

Value

A list of reactive values to control the experiment.


ndphillips/ShinyPsych documentation built on Feb. 14, 2022, 5:53 p.m.