Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny progress bar during loading RData, Package?

Tags:

r

shiny

I am not sure if I can show any reproducible example here, however let me narrate the issue I am facing with my Shiny app.

I have a Shiny app, which is basically data driven. All my required data is saved in an RData file which is placed in WWW folder. When user put my Shiny app's address (which is hosted on Amazon AWS) i.e. when my Shiny app starts, that RData file is loaded onto R, and then subsequent calculation starts.

The issue is that, my RData file is of quite huge size ~50MB. So R takes quite long time to load that onto memory. From User's perspective, he/she is not sure what is happening behind the screen, that makes some of them leave my App.

So I was thinking if I can put some progress bar to show User something is happening, as that Progress bar would be displayed only during the time when R is loading my RData file. I am aware of various Progress bar schemes available for Shiny, however as far as I know they are to display progress only during calculation (e.g. simulation) not during loading something.

Any idea if it is possible to put some Progress bar during loading RData, package etc?

Thanks for any pointer.

like image 351
Bogaso Avatar asked Apr 04 '18 14:04

Bogaso


1 Answers

maybe a bit late but I share what I used, should it be useful for someone else.

Take a look at the shinycssloaders package (https://github.com/andrewsali/shinycssloaders).

By adding a simple function withSpinner and set a few parameters, you'll be able to set loader animations to Shiny apps. Furthermore you can select different spinners by looking at this link https://projects.lukehaas.me/css-loaders/.

I used it when I made this app: https://abenedetti.shinyapps.io/bioNPS/ Look at the Species Choropleth map section.

Edit: Maybe this article and this app could help. Did you had a look at them?

like image 107
Alessio Avatar answered Oct 10 '22 12:10

Alessio