我使用Shiny GUI R包.我正在寻找一种在按下actionButton后显示"loading ..."等消息的方法.该函数需要几分钟才能执行,因此我需要以某种方式通知用户按钮实际触发了某个事件.现在server.R代码如下所示:
DATA <- reactive({
if(input$DownloadButton>0) {
RunDownload()
} else {
NULL
}
})
output$Download <- renderText({
if(NROW(DATA())>0) {
paste0(Sys.time(),": ",NROW(DATA()), " items downloaded")
} else {
''
}
})
Run Code Online (Sandbox Code Playgroud)
actionButton()是一种从互联网下载数据的功能.input$DownloadButton是actionButton.因此,在按下按钮后,用户等待几分钟,然后才会看到一条消息,说下载成功.我想在按下actionButton之后显示消息"正在加载...",然后paste0(Sys.time(),": ",NROW(DATA()), " items downloaded")在执行结束时显示另一条消息.