Skip to content

Instantly share code, notes, and snippets.

@jdesilvio
Last active February 24, 2021 04:09
Show Gist options
  • Save jdesilvio/eb47317b8473a21adf87 to your computer and use it in GitHub Desktop.
Save jdesilvio/eb47317b8473a21adf87 to your computer and use it in GitHub Desktop.
Template for a basic R Shiny app
# import libraries
library(shiny)
##########
# SERVER #
##########
#generic line initiating the SERVER
server <- shinyServer(function(input, output) {
#########################
# Data load and cleanup #
#########################
#Import data
#Clean data
#############
# Reactives #
#############
# define any reactive elements of the app
#Close the server definition
})
##################
# User Interface #
##################
#generic line initiating the UI
ui <- shinyUI(fluidPage(
#Add a title
titlePanel("Add Title Here"),
#This creates a layout with a left sidebar and main section
sidebarLayout(
#beginning of sidebar section
#usually includes inputs
sidebarPanel(),
#beginning of main section
mainPanel()
)
#Close the UI definition
))
##############
# Launch App #
##############
#generic line that launches the app
shinyApp(ui = ui, server = server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment