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.

Include data files in a Shiny app

Include data files in a Shiny app

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

Start my 1-month free trial

Include data files in a Shiny app

- [Narrator] Often times you want to display data in a Shiny app from a data file on your machine. The most flexible way to do this is by putting your data file in the same directory as your Shiny app. This will ensure that when you attempt to deploy your Shiny app to a server, the data file and all of the Shiny code will be deployed and your app will work correctly. It's good convention to put your data files into a sub folder called data. That means when you look at your Shiny app, you can see where your data lives and where your Shiny code lives. Let's see this in practice by going to our exercise files. So we'll go to folder 05_02 and we'll open up our R Studio project. I'm going to open the server that our file, and we can see what we want to do in this app is to create an interactive table to display our data. So let's have a look at how we do this by loading the libraries at the top of our script file. So we'll load the DT library and the tidyverse library as well. Let's create…

Contents