Setting up shiny-server and creating a first app: “How long are 4 seconds”

I liked the idea of Shiny and being able to deploy an app easily via Shiny Server. Therefore, I tried the installation and app creation process out myself.

Here is the final result. Try to estimate the time span of 4 seconds!

The installation of Shiny Server is very nicely explained here. The following commands are sufficient for my Ubuntu server.

Useful to restart the Shiny Server was also

I changed the port to be used from the default port to the port 9998 in the config file, found at

All .R files for the first app live under /srv/shiny-server/sample-apps/timeestimate. Since I read and write data to /srv/shiny-server/sample-apps/timeestimate/data I had to give write access to shiny via

I wanted to create an app, that lets users guess the time span of four seconds. Therefore I needed just one button that changes from a start to a stop button regarding of what it was before and a way to display the data. Here are the ui.R file and the server.R file.

One thing that is not here in the code as I edited it later: I throw away outliers where people estimate the time as 8 seconds or more as this screw the histogram creation.

Try it out yourself here.

I want to analyze the output in the future. However, there is some delay with the whole process, so it might be more optimal to move the timing to the client side. For the current version, a histogram is shown below.

Leave a Reply