class: center, middle, inverse, title-slide .title[ # Interactive web apps
⭐ ] .author[ ### S. Mason Garrison ] --- layout: true <div class="my-footer"> <span> <a href="https://DataScience4Psych.github.io/DataScience4Psych/" target="_blank">Data Science for Psychologists</a> </span> </div> --- class: middle # Learning Goals --- ## Learning Goals By the end of this session, you will be able to... - Build interactive web applications using Shiny - Understand basic anatomy of Shiny apps (UI and server components) - Deploy interactive visualizations for exploratory data analysis - Combine Shiny with R Markdown documents --- ## Shiny .pull-left[ - Shiny is an R package that makes it easy to build interactive web apps straight from R - You can host standalone apps on a webpage or embed them in R Markdown documents or build dashboards - You can also extend your Shiny apps with CSS themes, htmlwidgets, and JavaScript actions - Learn more at [shiny.rstudio.com](https://shiny.rstudio.com/) ] .pull-right[ <img src="img/shiny.png" alt="" width="60%" style="display: block; margin: auto auto auto 0;" /> ] --- ## High level view - Every Shiny app has a webpage that the user visits, and behind this webpage there is a computer that serves this webpage by running R - When running your app locally, the computer serving your app is your computer - When your app is deployed, the computer serving your app is a web server --- ## Anatomy of a Shiny app - User interface - controls the layout and appearance of app - Server function - contains instructions needed to build app ``` r library(shiny) # User interface ui <- fluidPage() # Server function server <- function(input, output) {} shinyApp(ui = ui, server = server) ``` --- class: middle # Summary: Learning Goals Achieved --- ## What We've Learned Today, you should now be able to... .pull-left[ ### Concepts - ✅ Shiny app structure - ✅ UI and server components - ✅ Interactive visualizations ] .pull-right[ ### Skills - ✅ Build Shiny apps - ✅ Deploy interactive apps - ✅ Combine Shiny with R Markdown ] --- class: middle # Wrapping Up...