analyze <- function() {
lapply(1:5, function(x) { cat(x); Sys.sleep(1) })
}
runApp(shinyApp(
ui = fluidPage(
actionButton("analyze", "Analyze", class = "btn-primary"),
actionButton("stop", "Stop")
),
server = function(input, output, session) {
observeEvent(input$analyze, {
analyze()
})
observeEvent(input$stop, {
# stop the slow analyze() function
})
}
))
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/e4171155-b44d-4bfb-9861-d43d3b646b79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sounds great! Fingers crossed that you find a way.
Sent from my mobile device