【发布时间】:2016-08-26 14:22:06
【问题描述】:
我的代码在这里:
ui.R
shinyUI(fluidPage(
# Copy the line below to make a select box
selectInput("select", label = h3("Select box"),
choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),
selected = 1),
numericInput("value",label="value", value=100),
hr(),
fluidRow(column(3, verbatimTextOutput("value")))
))
服务器.R
server=shinyServer(function(input, output) {
output$inputs=renderUI({
if(input$select =="1"){
numericInput(inputId = paste0("value",1),"1",100)
} else if(input$select=="2"){
numericInput(inputId ="value","value",100),
numericInput(inputId ="value","value",200),
numericInput(inputId ="value","value",300)
}
})
# You can access the value of the widget with input$select, e.g.
output$value <- renderPrint({ input$select })
})
那么我怎样才能达到我的期望呢?
【问题讨论】:
标签: shiny shiny-server shinydashboard