r - R Shiny:在另一个(相对较长的)计算完成之前更新输出
问题描述
我有以下问题。单击按钮后,我闪亮的应用程序基本上在服务器端执行以下操作:
observe({
isolate({
## Here are a lots of computations with the results shown iteratively using invalidateLater():
})
if( computations not done ){
invalidateLater(500)
} else {
#Once the computations are done, I create a final output table and also a image.
output$example <- renderTable( something based on the computations )
output$example2 <- renderPlot( something based on the computations )
#Here comes code to save the results of the computation in a database
})
这是我的问题:保存到数据库大约需要 3 秒。这不是世界末日,但我的问题是最终输出仅在保存完成后才呈现。
我想改变这一点,那就是我想先渲染输出(这真的不需要很长时间,也许半秒)。我尝试了不同的方法,例如将代码保存到另一个观察和/或隔离块中,但我无法完成。有没有办法做到这一点?
解决方案
推荐阅读
- python - 如何将一个列表的项目逐个添加到另一个列表?
- dynamic - Vue2 Element-UI Datepicker 强制刷新动态 disabledDate
- sql - 获取所有具有选定配件的车辆
- spring-data-redis - RedisSentinelConfiguration 使用 spring.redis.sentinel.nodes 和 spring boot
- c# - 如何在 C# 运行时使用数组制作 n*n 按钮?
- javascript - 循环遍历 xml2js 解析的 json 项时无法访问 xml 属性
- javascript - 如何在 plotly 中绘制 2D 箱线图?
- python - 多尺度模板匹配无法正常工作
- javascript - 电子中的假 Document.visibilityState
- angular - 是否可以从 formcontrol 获取 minlength 值?