ShinyPsych is an collection of psychology tasks (mostly decision making) written in Shiny, a web application framework built on the R programming language. The purpose of ShinyPsych is to give researchers the tools to create and impliment their own experiments online as easily as possible.

ShinyPsych Applications

Here are the applications currently available (in one stage or another) in the ShinyPsych collection. The best way to see what the applications do is to play them yourself! To see the underlying code and accompanying tutorials, click the code link:

Name / Page Link Example Description Repository (code and guide)
ShinyBART Play ShinyBART The Balloon Analogue Risk Task (Lejuez et al. 2002) www.github.com/ndphillips/ShinyBART
ShinyBandit Play ShinyBandit An N-armed bandit task (Sutton and Barto 1998) www.github.com/ndphillips/ShinyBandit

Please contribute!

ShinyPsych is currently in the very early stages of development and I welcome comments, suggestions, and new applications. Github users can post issues or pull requests at www.github.com/ndphillips/ShinyPsych or at individual repositories.

In depth tutorials, from Markdown to YouTube videos, are coming…

What is Shiny?

Shiny is a web application framework for the R programming language. It allows you to create interactive web applications without knowing any HTML, CSS or JavaScript.

Why is Shiny so great for creating online experiments?

Most reseachers I know who program online experiments use one of two methods. They either rely on survey software such as Unipark or Qualtrics, or they program their experiments from scratch in JavaScript, HTML and CSS. Let’s contrast Shiny with two other common solutions for running online experiments

Survey Software
(e.g.; Unipark, Qualtrics)
JavaScript/HTML/PHP Shiny
Cost High Low Low
Ease of learning Medium Low High*
(assuming you know R!)
Ease of writing Medium Medium High
Customisation Low High High
Data and Statistics Integration Low Low High

Shiny is free!: Because R is open source, and RStudio will run apps for free (with some small restrictions), you can use the Shiny framework to write and run your experiments completely for free.

Shiny easy to learn: The Shiny website has a huge body of very helpful tutorials that will get you writing your own applications in minutes. Even better, while Shiny is relatively new, there is already a huge community of developers writing and sharing Shiny apps online. Just Google a Shiny question, and you’ll almost certainly find the answer.

Shiny is easy to write: As Shiny is built on R, it is very easy to write and understand. This is in contrast to HTML and JavaScript which can becomine quite messy. As R and Shiny take care of all the data management, processing, and displays, you can program complex experiments in a single language.

Shiny is easy to customize: Is there something missing in Shiny that you wish you could add with HTML, CSS or JavaScript? No problem! Just add the code and it will be integrated into your app.

Shiny gives you all the beautiful data management and statistics of R: Because Shiny is built on R, you get to take advantage of all the beautiful data management and statistical power of R when running your experiments. This means that, unlike commercial survey software such as Unipark, and Qualtrics, with Shiny you can store, manipulate, and save your data in the exact format you want to conduct your analysis.

References

Lejuez, Carl W, Jennifer P Read, Christopher W Kahler, Jerry B Richards, Susan E Ramsey, Gregory L Stuart, David R Strong, and Richard A Brown. 2002. “Evaluation of a Behavioral Measure of Risk Taking: The Balloon Analogue Risk Task (Bart).” Journal of Experimental Psychology: Applied 8 (2). American Psychological Association: 75.

Sutton, Richard S, and Andrew G Barto. 1998. Reinforcement Learning: An Introduction. Vol. 1. 1. MIT press Cambridge.