【发布时间】:2015-09-23 07:53:27
【问题描述】:
在我的 R 闪亮应用中,我的 tabsetPanel 中有许多 tabPanel。
在我单击该选项卡之前,不会开始加载特定选项卡的图表。
所以只浏览所有选项卡的内容需要很长时间。
有没有什么方法可以在应用启动时先处理所有选项卡,这样当我转到不同的选项卡时所有图表都已经存在?
我用两个直方图创建了一个简单的例子:
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(100000000), col = 'darkgray', border = 'white')
})
output$distPlot2 <- renderPlot({
hist(rnorm(100000000), col = 'red', border = 'white')
})
outputOptions(output,"distPlot2",suspendWhenHidden = FALSE)
}
ui <- fluidPage(
tabsetPanel(
tabPanel("1",plotOutput("distPlot")
),
tabPanel("2",plotOutput("distPlot2")
)
)
)
shinyApp(ui = ui, server = server)
我定时加载这两个直方图,发现选项 suspendWhenHidden = FALSE 在这里不起作用。如何解决?
【问题讨论】: