I have created an shiny app which runs a function() and generates multiple outputs to render to the UI. Also, this function has been wrapped with "eventReactive()" which controlled by an "ActionButton" in the UI.
However, since this function is an optimization function which iterates 5 - 10 minutes, people have to wait till the search function finish to see the result (Multiple function outputs).
I would like my user to see the modeling progress (like print()s in the search function) while the function is running (in realtime) instead of just waiting. So, I am wondering if it is possible to use "renderPrint" or "renderText" in a way that can render the "prints" in the search function while it is running?
The basic structure of my shiny App is:
server.r
# source optimal_fun()
source("optimal_fun.r")
# server.r main
shinyServer(function(input, output) {
# ----------- use 'eventreactive()' for 'action button'
model <- eventReactive(input$goButton, {
optimal_fun()
})
# render fun() result1
output$result1 <- renderTable({
model()$result1
})
# render fun() result2
output$result1 <- renderTable({
model()$result2
})
# render fun() result3
output$result1 <- renderTable({
model()$result3
})
# ------- render all outputs to UI
output$tb <- renderUI({
tabsetPanel(tabPanel("result1", tableOutput("result1")),
tabPanel("result2", tableOutput("result2")),
tabPanel("result3", tableOutput("result3")))
})
})
Thanks! Any suggestion or guidance would be really appreciated.:)