Description Usage Arguments Details Value Functions
View source: R/n_armed_bandit_page.R
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
.
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"
)
|
ctrlValsList |
list of reactive values. Controls the flow through the
Experiment. Can be created with |
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". |
These functions are called from within multiArmedBanditPage
because this also handles the appropriate custom message.
An html page that can be displayed by the shiny app.
threeArmedBanditPage
: A three armed bandit version
fourArmedBanditPage
: A four armed bandit version
fiveArmedBanditPage
: A five armed bandit version
sixArmedBanditPage
: A six armed bandit version
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.