【发布时间】:2019-09-20 10:43:06
【问题描述】:
我对闪亮还很陌生,遇到过其他人遇到过的问题,但我似乎找不到解决方案。我的 Rshiny 应用程序中的条件面板显示了我的所有条件。我参考了以下链接,甚至尝试了 renderUI 解决方案,但没有运气。这似乎是一个我只是想念的简单问题,但任何帮助、条件面板的替代解决方案或对问题所在位置的见解将不胜感激!
(然后使用框中的值来更新图表,当我在我的应用程序中使用此解决方案时,图表也不再显示。我可以共享多少其他代码受到限制)
R shiny conditionalPanel displaying both conditions
To add the values in dynamically created textBox in RShiny
Producing dynamic/multiple input boxes to collect data depending on user selection in Shiny R
runApp(list(
ui = bootstrapPage(
selectInput("ctype","test:" , c("F", "S"), selected = F),
conditionalPanel("input.ctype == 'F'",
numericInput("comp", "Box 1", value = 100),
numericInput("comp1", "Box 2", value = 200),
numericInput("comp2", "Box3", value = 300),
actionButton("revert", "Back", icon = icon("history"))
),
conditionalPanel("input.ctype == 'S",
numericInput("comp3", "Box 4", value = 0))
),
server = function(input, output) {
output$plot <- renderPlot({ hist(runif(input$n)) })
}
))
下面是当前的输出。我需要的是,只选择“f”,只有“框1”,“框2”,“框3”和“返回”出现和不是 EM>“框4”强>。仅出现“s”时选择“box 4”。
【问题讨论】:
-
你想要的输出是什么?
-
已编辑以进一步解释所需的输出@JohanRosa
-
在@Shawn Fries 的建议下,这可能是一个简单的小代码错误
标签: r shiny conditional