I have only started using shiny 2 days back so forgive me if this is very naive question but I have looked around and cannot find a simple answer. I am creating an app that will take a while to complete. I want to keep the output updated with intermediate steps of the program. I can print to the output once the program completes but how do I print intermediate steps.
Eg in the following minimal app code it prints the numbers 1 to 10 after 10 seconds but how can I make it print at each second interval?
library(shiny)
runApp(list(
ui = basicPage(
h2('Multiple output'),
actionButton("goButton", "Go!"),
textOutput("out")
),
server = function(input, output) {
output$out = renderText({
if(input$goButton == 1 ) {
msg = NULL
for(i in 1:10) {
Sys.sleep(1)
msg = paste(msg,i)
}
msg
}
})
}
))