【发布时间】:2017-12-04 12:33:04
【问题描述】:
我正在学习 R 和 Shiny,并且一直在尝试使用 Shiny 包文档 here 中的一些代码。我一直在试图弄清楚为什么我添加的条件没有响应我的条件。 我做错了什么,因为我没有收到错误?
ui <- fluidPage(
uiOutput("ex")
)
server <- function(input, output) {
output$ex <- renderUI({
tagList(
selectInput("n","Please Select :",
choices = c("N","U","T")),
conditionalPanel(condition = "n"=="N",
textInput("inmean"," Mean:",0.25),
textInput("invsd","Sd", 0.02)),
conditionalPanel(condition = "n"== "U",
textInput("inmean","Mean:",0.25),
textInput("insd","Sd", 0.02))
)
})
}
shinyApp(ui, server)
【问题讨论】:
-
你的条件应该是
"input.n == 'N'" -
啊,是的,解决了它。谢谢
标签: r rstudio shiny shinydashboard