From the course: Building Data Apps with R and Shiny: Essential Training

Unlock the full course today

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

Split-file apps

Split-file apps

From the course: Building Data Apps with R and Shiny: Essential Training

Start my 1-month free trial

Split-file apps

- [Voiceover] Let's take a look at how we build split files apps in Shiny. We're going to build an app from scratch, so you can see everything that's involved. To start, we're going to go to our exercise files and open folder 02_02. We have an NTR studio project here. Let's open it up and start building our Shiny app. The first thing that we do, is we create two new script files. The first one we're going to save as ui.r, and the second script file we're going to save as server.r. And as soon as our studio sees the folder containing these two specially named files, it gives us a button here called "run it." If I click this, we get a bunch of errors here saying that no UI is defined and Shiny couldn't find any UI for this application. And that's because we haven't specified our user experience in the ui.r file yet. So let's close this dialogue and go over to our ui.r and build us a user experience. We're going to create a very minimal ui. We're going to use the function navbarPage…

Contents