有人可以帮助我解决以下闪亮问题: 我需要制作一个条件面板,但在这里我不希望它出现,除非有人选择女性。但是,当我运行此代码时,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"))))
答案 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')))