0
我正在制作一个闪亮的应用程序,它将Google数据从Google表格文档中提取到Google Drive中。在下面的MWE中,它只是列出了表格。闪亮 - 更新Google表格
我想要应用程序呈现Google表格的当前状态,因此我添加了invalidateLater以反应性表达式从Google Drive中读取数据。
缺点是每次刷新表时也是如此,即使数据没有改变。任何想法如何处理?
MWE:
ui.R
library(shiny)
library(shinydashboard)
header <- dashboardHeader(title = "Title")
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("All", tabName = "All", icon = icon("fa fa-circle")
)
)
)
body <- dashboardBody(
tabItems(
tabItem(tabName = "All",
fluidRow( box(width=12,title="Table",
solidHeader = TRUE,status = "primary",
dataTableOutput(outputId="Munt")
#plotOutput(outputID="Munt")
)
)
)
))
ui <- dashboardPage(header, sidebar,body)
server.R
server<-function(input,output,session){
session$onSessionEnded(function() {
stopApp()
})
DF<-reactive({
invalidateLater(60000,session=session)
temp<-gs_read(muntgeg)
temp})
output$Munt<-renderDataTable(DF())
}
global.R
library(shiny)
library(knitr)
library(googlesheets)
muntgeg<-gs_title("RA-Munten")