即使条件满足,R Shiny条件面板也不会出现

时间:2016-03-14 14:32:34

标签: r shiny

如果用户选择不仅保留名词和形容词("pos" selectInput设置为FALSE),则应提示他们是否应删除停用词("stop" selectInput)。

然而,尽管我小心地在JS而不是R中编写条件,但条件面板永远不会出现,即使满足条件。我很难过。

最小可重复的例子:

shinyApp(

ui = shinyUI(fluidPage(

fluidRow(
column (2,
wellPanel(
h5("Parameters"),
tabsetPanel(
tabPanel("Text",
selectInput("pos", label = h5("Keep only nouns & adjectives?"), choices = list("Yes" = TRUE, "No" = FALSE), selected = TRUE),
conditionalPanel(
condition = "input.pos == false",
selectInput("stop", label = h5("Remove stopwords?"), choices = list("Yes" = TRUE, "No" = FALSE), selected = TRUE)
)))))))),

server = shinyServer(function(input, output) {

})

)

1 个答案:

答案 0 :(得分:1)

您的病情需要报价和大写......

shinyApp(

  ui = shinyUI(fluidPage(

    fluidRow(
      column (2,
              wellPanel(
                h5("Parameters"),
                tabsetPanel(
                  tabPanel("Text",
                           selectInput("pos", label = h5("Keep only nouns & adjectives?"), choices = list("Yes" = TRUE, "No" = FALSE), selected = TRUE),
                           conditionalPanel(
                             condition = "input.pos == 'FALSE'",
                             selectInput("stop", label = h5("Remove stopwords?"), choices = list("Yes" = TRUE, "No" = FALSE), selected = TRUE)
                           )))))))),

  server = shinyServer(function(input, output) {

  })

)