mardi 7 novembre 2017

ReactiveTimer with if statement R-Shiny

I've made a R-Shiny app which runs on a linux server. All the data which I need is coming from a website using API and the library(coinmarketcapr).

The app retrieves the latest data every 5 minutes and saves it in a csv-file on the server.

But now I have the problem that every time I reload the page, the app retrieves the new data and I always have duplicate values in my time series.

I work with the ReactiveTimer, set to 5 minutes.

Is there a possibility that the ReactiveTimer checks the time of the last entry in the csv-file and compares it with the current system time? If the time in the csv-file should be 5 minutes or older than the system time, he should execute the code, otherwise not.

I also wanted to ask if anyone knows if you can run a shiny app without having it open in the browser, i. e. the code is constantly running and collecting data?

Aucun commentaire:

Enregistrer un commentaire