Lucy D'Agostino McGowan walks through the three core parts of a Shiny Dashboard: header, sidebar, and body. Each uses CamelCase functions like dashboardHeader and dashboardSidebar, which combine into dashboardPage and pair with a server function via shinyApp to launch a working dashboard.
Chapters
I'm Lucy D' Agostino McGowan. I work in biostatistics and originally learned R specifically to meet my statistical needs. But since then I've learned a lot about R's strength to help communicate data and results specifically via Shiny and Shiny Dashboard. These tools are so powerful both for visualizing and communicating various steps in the data science pipeline. For this first section, you're going to learn about the Shiny Dashboard structure. I'll go over the different components and then you'll be able to give it a whirl. The UI user interface of a Shiny Dashboard is comprised of three main the header, the sidebar, and the body. Here's an empty dashboard. The blue bar on the top is the header, the dark blue portion on the left is the sidebar, and the gray portion in the center is the body. The header is edited using the Dashboard Header function. Take a minute to notice here how the function is in Camel case, by which I mean you can tell when there's a new word because it's capitalized the H and header and it looks like a hump on a camel. This is common syntax throughout the Shiny Dashboard ecosystem. The Dashboard header is created using the Dashboard Header function. Similarly, the Dashboard sidebar and the Dashboard Body functions. Edit the sidebar and the Body. You can combine these three pieces using the Dashboard page function to make the UI the user interface. We can then use this UI along with an empty server function with Shiny's ShinyApp function to spin up an empty Dashboard. Now you can give it a try. You'll build a dashboard for NASA's International Space Station.