I am building my first Shiny app - you can access the live version here: http://justmytwospence.shinyapps.io/StepLively/
It works fine, but you can probably see my problem as soon as you load the page. All of hte outputs hinge on a reactive conductor that takes a while to execute (its the function that actually performs a step-wise regression). Therefore, my outputs display error messages until the reactive conductor finishes executing. This only takes a few seconds, but it very annoying and unpolished.
Is there a way to schedule the execution of the reactive endpoints so that they don't execute until the reactive conductor has finished? Alternatively- but less favorably- is there a way to test for the availability of the reactive conductor and display something else when it is not available. Something along the lines of if (reactive_conductor_function()) {blah}
. That won't work, however, because its a function.
Edit: I added an "Execute" button to completely bypass this issue, so its not evident in the app at the moment.
You could try something like:
if(is.null(reactive_conductor_function()){return(NULL)}
#rest of your code follows
or
reactive_data <- reactive_conductor_function()
if(is.null(reactive_data)){return(NULL)}
#rest of your code follows
Both of these will prevent anything downstream in that code block from happening until after the reactive_conductor_function has data. I'm not sure on the first one, but I frequently use the second version of this code.
I would be able to give better advice if you could post some code examples!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With