Yes, there is. On a past job of mine, we built a shiny dash that was basically a while (true)
and Sys.sleep(5)
that kept updating the dashboard data.
It would certainly be necessary to refactor the code for this new structure.
However, I do not know if I would do it today. I would probably do the extraction and update of a local database with a dedicated script only (probably in python
, but could be in R
same) and I would run it periodically with cron
job if your OS for * nix or with Task Scheduler
in Windows.
If data processing is very complex, with multiple dependencies and decisions in the process, it would make an application with Make
(which has a package to facilitate in the R
language) or would have a local server / process with Airflow
or% with% would only take account of the extraction and processing of the data, and the Dash application would only connect with the data source, updating at each X time or with an update button, leaving it to the user. >