使用 R 构建 Shiny Web 应用
Kaelen Medeiros
Data Scientist
Shiny 提供多种可选输入。




selectInput("inputId",
"label",
choices = c("A", "B", "C"))
sliderInput("inputId",
"label",
value = 1925,
min = 1900,
max = 2000)
?dateRangeInput
help(checkboxInput)
ui <- fluidPage( textInput("name", "输入姓名:"), selectInput("animal", "狗还是猫?", choices = c("dogs", "cats")), textOutput("greeting"), textOutput("answer") )server <- function(input, output, session) { output$greeting <- renderText({ paste("您更喜欢狗还是猫,", input$name, "?") }) output$answer <- renderText({ paste("我更喜欢", input$animal, "!") }) }
使用 R 构建 Shiny Web 应用