条件面板有光泽(似乎不起作用)

时间:2013-10-30 18:22:49

标签: r shiny

有人可以帮助我解决以下闪亮问题: 我需要制作一个条件面板,但在这里我不希望它出现,除非有人选择女性。但是,当我运行此代码时,conditionalPanel会出现在页面中。 任何帮助将不胜感激......

selectInput("gender", 
            "What is your gender?", 
            choices = c(Male="Male", Female="Female")),
conditionalPanel(condition = "input.gender=='Female'", 
                 selectInput("cond_sel",  
                             "Are you pregnant?", 
                             c("Yes", "No"))))

1 个答案:

答案 0 :(得分:1)

selectInput("gender", 
            "What is your gender?", 
            choices = c(Male="Male", Female="Female"),selected='Male'),
conditionalPanel(condition = "input.gender=='Female'", 
                 selectInput("cond_sel",  
                             "Are you pregnant?", 
                             c("Yes", "No"),selected='No')))