Skip to content

Instantly share code, notes, and snippets.

@ageller
Last active July 27, 2023 10:31
Show Gist options
  • Save ageller/092f9d95f2e3b67bd7deb2ac3982fa59 to your computer and use it in GitHub Desktop.
Save ageller/092f9d95f2e3b67bd7deb2ac3982fa59 to your computer and use it in GitHub Desktop.
typical Shiny app skeleton
# import libraries
library(shiny)
# possibly read in some data to be used below
# define the UI
ui <- fluidPage(
# app title
headerPanel("My Title"),
# sidebar panel for inputs
sidebarPanel(
# add dropdowns, sliders, checkboxes, radio buttons, etc.
),
# main panel for displaying outputs
mainPanel(
# add text, plots, etc
)
)
# define server logic
server <- function(input, output) {
# make use of any of the inputs that came from the sidebarPanel
# generate output text, plots, etc. that will be shown in the mainPanel
}
# start the app
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment