2017-10-20 43 views

回答

2

它可能取决于您尝试更新的无功元素,但是你可以想象用封装的反应式轮询和floor_date来做到这一点。

所以,你必须依赖于由reactivePoll功能提供数据的一些活性元素,并每5分钟间隔该数据更新,就像这样:

data <- reactivePoll(intervalMillis = 60000, session, 
         checkFunc = function() { 
          #check the time, rounded down to the previous 5 minute interval 
          lubridate::floor_date(Sys.time(), "5 mins") 
         }, 

         valueFunc = function() { 
          #if checkFunc value has changed since the last check, return some updated value or updated dataset 
          get_value()       
         } 
)