twoArmedBanditPage: Create an HTML Page to Display and Play a 2 to 6 Armed Bandit

Description Usage Arguments Details Value Functions

View source: R/n_armed_bandit_page.R

Description

Create an html page and send information to javascript if an option is clicked. Needs prepared lists of outcome values created by createBanditList or of the same structure and control variables created with createCtrlList.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
twoArmedBanditPage(
  ctrlValsList,
  gameTitle = "Game ",
  nTrials = NULL,
  clickCounter = "Clicks Remaining",
  gameTitlePractice = "Practice Game",
  withPracticeGame = TRUE,
  pointTitle = "Points Earned",
  nGames = 10,
  buttonLabel = "Click to Continue to next Game"
)

threeArmedBanditPage(
  ctrlValsList,
  gameTitle = "Game ",
  nTrials = NULL,
  clickCounter = "Clicks Remaining",
  gameTitlePractice = "Practice Game",
  withPracticeGame = TRUE,
  pointTitle = "Points Earned",
  nGames = 10,
  buttonLabel = "Click to Continue to next Game"
)

fourArmedBanditPage(
  ctrlValsList,
  gameTitle = "Game ",
  nTrials = NULL,
  clickCounter = "Clicks Remaining",
  gameTitlePractice = "Practice Game",
  withPracticeGame = TRUE,
  pointTitle = "Points Earned",
  nGames = 10,
  buttonLabel = "Click to Continue to next Game"
)

fiveArmedBanditPage(
  ctrlValsList,
  gameTitle = "Game ",
  nTrials = NULL,
  clickCounter = "Clicks Remaining",
  gameTitlePractice = "Practice Game",
  withPracticeGame = TRUE,
  pointTitle = "Points Earned",
  nGames = 10,
  buttonLabel = "Click to Continue to next Game"
)

sixArmedBanditPage(
  ctrlValsList,
  gameTitle = "Game ",
  nTrials = NULL,
  clickCounter = "Clicks Remaining",
  gameTitlePractice = "Practice Game",
  withPracticeGame = TRUE,
  pointTitle = "Points Earned",
  nGames = 10,
  buttonLabel = "Click to Continue to next Game"
)

Arguments

ctrlValsList

list of reactive values. Controls the flow through the Experiment. Can be created with createCtrlList.

gameTitle

string. Is displayed as title of the trial, e.g. if it is set to "Game" the displayed title in game 2 of 10 will be "Game 2 of 10".

nTrials

integer. The number of games played WITHOUT the practice game.

clickCounter

string. Is displayed next to the number of clicks still left in one game. Default is set to "Clicks Remaining".

gameTitlePractice

string. Is displayed as title of the practice game.

withPracticeGame

logical. If TRUE (default) a practice game must be provided and will be displayed.

pointTitle

string. Is displayed as label next to the number of points earned. Default is set to "Points Earned".

nGames

integer. The number of games played WITHOUT the practice game.

buttonLabel

string. Is displayed in the continue button. Default is set to "Click to Continue to next Game".

Details

These functions are called from within multiArmedBanditPage because this also handles the appropriate custom message.

Value

An html page that can be displayed by the shiny app.

Functions


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