From the course: Building Data Apps with R and Shiny: Essential Training
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Include data files in a Shiny app
From the course: Building Data Apps with R and Shiny: Essential Training
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…
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.