As I mentioned earlier I’ve built a shiny app to visualize the development of SARS-CoV-2 in Germany.
Running it locally works very well. But how to deploy an app in the web?
There is a free service at shinyapps.io where you can host your shiny app.
But the free plan offers only a fixed amount of memory. The data my app is reading consumes more memory than I get there. So I was looking for a way my app can detect whether it is running at shinyapps.io or not. Depending on the result of this check I can offer different features to the user (such as updating the data).
It turns out that there is an environment variable set at shinyapps.io:
Sys.getenv("R_CONFIG_ACTIVE") == "shinyapps"
So depending on the value of
R_CONFIG_ACTIVE you can change the behaviour of your app.