Shiny conditionalPanel - 基于前面输入的不同选项

时间:2017-02-18 23:09:39

标签: r shiny

我正在尝试创建一个conditionalPanel,显示填写前一个input的时间。我希望conditionalPanel根据初始input填充选项。

我的代码看起来像这样:

   selectInput("initialvalue", "Initial Value", c("Choose one" = "", as.character(initialvaluelist))),
   conditionalPanel(
     condition = "input.initialvalue=='First Option'",
     selectInput("conditionalchoices", "Conditional Choices", choices = c("Click to select from list" = "", firstoptionchoices), selected = NULL, multiple=TRUE)),
   conditionalPanel(
     condition = "input.initialvalue=='Second Option'",
     selectInput("conditionalchoices", "Conditional Choices", choices = c("Click to select from list" = "", secondoptionchoices), selected = NULL, multiple=TRUE))

在此示例中,选择First Option会提升firstoptionchoices,选择Second Option会提升secondoptionchoices

这适用于UI,但只有第一个conditionalPanel条件才会更新反应变量。第二个没有。我错过了什么?

0 个答案:

没有答案