我一直致力于为复杂的决策工具开发一个Shiny应用程序,一旦完成,它将使用大约150个conditionalPanel()
函数,其中许多依赖于之前的函数。而且大部分都是针对条件的selectInput()
这是一个例子:
#partial ui.R
##############
conditionalPanel(condition = "input.options_count >= 4 & input.criteria_count >= 2 & input.subCri1 == 'Yes'",
uiOutput("OptionAssessment1_1_6"))
#partial server.R
##############
output$OptionAssessment1_1_6 <- renderUI({
option1 <- strsplit(input$options_text, ", ")[[1]][3]
option2 <- strsplit(input$options_text, ", ")[[1]][4]
criteria <- strsplit(input$subCri1a, ", ")[[1]][1]
selectInput("OptionAssessment1_1_6",
label = paste0("How much better is ", option1, " than ", option2, " at meeting ", criteria, "?"),
c("9 (Extremely better)",
"7 (Much better)",
"5 (Moderately better)",
"3 (Slightly better)",
"1 (Equally as well)",
"1/3 (Slightly worse)",
"1/5 (Moderately worse)",
"1/7 (Much worse)",
"1/9 (Extremely worse)"),
selected = "1 (Equally as well)")
})
在一定数量的conditionalPanel之后,我的应用程序在本地计算机上运行时永远不会完全加载(所以此时忘记在服务器上)。
我在服务器上找到了关于微调应用程序性能的Shiny文档,但有没有人有经验(或文档)来调整非常复杂和有条件的Shiny应用程序?我希望可能有某种方式分阶段执行它。
提前谢谢。