我是Shiny的新手,想知道选择选项后如何打开/显示新表单。
在下面的示例中,如果我选择“上载”,那么我想打开/显示一个可以让我上载数据的表单;如果我选择“分析数据”,那么它会让我打开/显示一个可以让我进行分析的表单。数据。
任何建议/帮助将不胜感激。
library(shiny)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
selectInput(inputId = "Task", label = "Select Task",choices = c("Please select","Upload","Analyze Data")),
textOutput("SR_Text")
)
# Define server logic required to draw a histogram
server <- function(input, output) {
observeEvent(input$Task, {
if(input$Task == "Upload"){
output$SR_Text<-renderText({
"Upload"
})
} else if (input$Task == "Analyze Data"){
output$SR_Text<-renderText({
"Analyze Data"
})
}
})
}
# Run the application
shinyApp(ui = ui, server = server)
这项工作吗?