【问题标题】:R Shiny use navbarPage together with conditionalPanelR Shiny 使用 navbarPage 和 conditionalPanel
【发布时间】:2014-07-10 14:20:48
【问题描述】:

R Shiny 是否支持在 navbarPage 中使用 conditionalPanel 来加载 tabPanel,即

 shinyUI(navbarPage(
 collapsable=TRUE,
 title="Clinical Information Network",

 tabPanel("Home",
        fluidRow(
          uiOutput("userPanel")      

)),

conditionalPanel(
condition = "logged.in == T",

tabPanel("DQA",....)
) #End conditional panels
)) #End shiny UI

我已经尝试过了,但它会产生乱码输出。您可以在 41.220.124.237:3838 查看结果。我做得对吗?

【问题讨论】:

  • 您需要使用renderUI创建navbarPage

标签: r shiny shiny-server


【解决方案1】:

在服务器上使用它。R:

output$secured <- renderUI({
  if(condition){
     tagList()
  }

}) 

而在 ui.R 上,就是这样使用标签

uiOutput("secured")

【讨论】:

    猜你喜欢
    • 2016-07-31
    • 1970-01-01
    • 1970-01-01
    • 2016-11-25
    • 2019-09-20
    • 2021-12-03
    • 2022-12-21
    • 2021-11-15
    • 1970-01-01
    相关资源
    最近更新 更多