multiArmedBanditPage: Call Appropriate Create Bandit Page Function and Send Data to...

Description Usage Arguments Value

View source: R/multi_armed_bandit_page.R

Description

Depending on the number of armes the bandit has, different create page functions are needed and different information has to be sent to the browser. This function takes care of this such that independend of the number of arms only one function has to be called to set up the html and javascript logic.

Usage

1
2
3
4
5
6
7
8
9
multiArmedBanditPage(
  ctrlVals,
  nArms,
  distList,
  container,
  roundDigits,
  session,
  ...
)

Arguments

ctrlVals

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

nArms

integer. Number of arms the bandit has. Must be between 2 and 6

distList

list. The one used to create the outcome lists with createBanditList.

container

list. Output of createBanditList containing the outcome values to be displayed in the game.

roundDigits

integer. The number of digits after the comma the total point value should be rounded to.

session

The session object from shiny

...

Further arguments passed to the nArmedBanditPage functions (e.g. twoArmedBanditPage).

Value

An html page that can be displayed by the shiny app. Also information is sent to javascript to animate the page.


mdsteiner/ShinyPsych documentation built on Feb. 12, 2022, 2:09 p.m.