From the course: Creating Interactive Presentations with Shiny and R

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Interdependent controls

Interdependent controls

From the course: Creating Interactive Presentations with Shiny and R

Start my 1-month free trial

Interdependent controls

- [Voiceover] It's often useful to have controls in your Shiny app which are dependent on one another, or what we might call interdependent controls. In order to have these in your Shiny app, you need to have an understanding of the UI and server-side of your code. So let's go over to our studio and in our studio, we're going to open up our exercises. So we'll go to projects in the top right hand corner, we'll go to open project, we'll go to the desktop exercise files, and we'll choose 04_04. We'll open up our project file and we can see that there are two markdown files which are opened up for us, an end and a begin file. We'll start with the begin file and what we're doing here is we're interacting with the function hist, which will generate us a histogram. If we scroll down to line 16, we can see this function being used in quite a trivial case, so here we generate a hundred numbers from the normal distribution and visualize the histogram. So let's convert this into a Shiny app…

Contents