Building Dashboards with shinydashboard
Png Kee Seng
Researcher
<type>input(<identifying label>, <displayed label>, ...)
selectInput()shinyApp()ui <- fluidPage( titlePanel("Sleeping habits in America"), selectInput("selectlabel", "Select an option",choices = c("Option 1", "Option 2", "Option 3", "Option 4"))
server <- function(input, output, session) {
}
shinyApp(ui, server)

multipleui <- fluidPage(
titlePanel("Sleeping habits in America"),
selectInput("selectlabel",
"Select an option",
choices = c("Option 1", "Option 2", "Option 3", "Option 4"),
multiple = TRUE))
server <- function(input, output, session) {
}
shinyApp(ui, server)

value: the value that the textbox is pre-filled withplaceholder: a preview of what the textbox should be filled withui <- fluidPage( titlePanel("Sleeping habits in America"), textInput("textlabel", "Tell me your name",value = "Birdie",placeholder = "Don"))
server <- function(input, output, session) {
}
shinyApp(ui, server)

value: either TRUE or FALSE, to toggle the initial state of the checkboxcheckboxInput, called checkboxGroupInputui <- fluidPage( titlePanel("Sleeping habits in America"), checkboxInput("checkboxlabel", "65 years and over",value = FALSE))server <- function(input, output, session) { } shinyApp(ui, server)

min and maxvaluestepui <- fluidPage( titlePanel("Sleeping habits in America"), sliderInput("sliderlabel", "Average hours of sleep",min = 7.5, max = 11,value = 9,step = 0.02))server <- function(input, output, session) { } shinyApp(ui, server)

ui <- fluidPage( titlePanel("Sleeping habits in America"), sliderInput("sliderlabel", "Average hours of sleep", min = 7.5, max = 11,value = c(8, 10),step = 0.02)) server <- function(input, output, session) { } shinyApp(ui, server)

Building Dashboards with shinydashboard