0
我在嘗試構建一個從S3存儲桶中獲取動態更新數據的Shiny應用程序。我目前可以提取數據,但不會自行更新。我已經通過reactiveFileReader
和examples的文檔,但無法弄清楚?幫助非常感謝!下面試圖將reactiveFileReader與AWS S3文件一起使用來更新Shiny應用
代碼:
getFile<-function(){
my_bucket <- 'globalrss'
file <- paste0(as.character(getwd()),"/tmp")
r <- aws.s3::save_object("bodytype.csv", my_bucket, file=file)
}
shinyServer(function(input, output, session) {
fileReaderData <- reactiveFileReader(500, session, getFile(), readLines)
output$fileReaderText <- renderText({
text <- fileReaderData()
length(text) <- 14
text[is.na(text)] <- ""
paste(text, collapse = '\n')
})
})`