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.
Labeling choices in selectInput
From the course: Building Data Apps with R and Shiny: Essential Training
Labeling choices in selectInput
- [Instructor] Okay, let's take a look at how we can label the choices and select input with Update Select Input. In our exercise files, I'd like you go to 0602, and we'll open up our RStudio project. Let's open up the ui.R file and the server.R file as well, and let's run our app to see what we're dealing with. So we have two tabs. The first tab is essentially already complete and the second tab is the one that we're going to be working on. So in the first tab, we select a country, so let's select Australia, and then we can select an indicator to display, and if we choose Commercial Bank Branches, we now have a chart showing the number of commercial bank branches over time in Australia. One weird thing here in the chart is rather than what we have shown in our pull-down menu, Commercial Bank Branches, we have this weird code here, and that's because this pull-down menu here is populated from a named vector. Let's switch over to the ui.R file to show you that. So in the ui.R file, if…
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.