From the course: Building Data Apps with R and Shiny: Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Interdependent controls to filter data
From the course: Building Data Apps with R and Shiny: Essential Training
Interdependent controls to filter data
- [Instructor] Let's take a look at how we can create interactive controls in our Shiny apps. To do that, let's go to our Exercises, and folder 06_03 and we'll open up our R Studio Project. Now let's open both our server.R and our ui.R file and we'll run our app to see what we're dealing with. So our app has two pull down menus, the first is called Select a Continent, so let's choose my home continent of Europe and we'll move over the Select a Country. Okay and we'd expect this country list to have been filtered by this Select a Continent. This is a really useful tool for you to build for your Shiny app users, where you have a number of controls which restrict the allowable values in other controls. So let's update the choices in Select a Country dependent on the value of the Select a Continent. To do this, we need to work in the server.R file. So let's close our Shiny app and go to the server.R file. At present we're using two update select inputs. What we actually need, is an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.