2017-10-20 40 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()       
         } 
)