0

My question is really similar to below:

R shiny: display “loading…” message while table is being rendered

Sorry I don't have enough reputation to comment it so I create a new question. My Shiny page has a renderGvis() and a renderDataTable() to display a graph and a table. Because it has to load() a 5 million rows table first, it takes a while to show up. And I have to have something to show it is loading, otherwise the users might leave. I found above post very useful but the loading message disappear too fast. The gap between it disappears and the table shows up is about 20s.

Before I saw above post, I did try below methodology:

#server.R   firstData is a reactive function to get the data for 1st table
output$firstTable = reactive({
return(is.null(firstData()))
})
#ui.R
  conditionalPanel(
      condition = "output.firstTable",
      box(width = 12,
              h1("The data is loading..."))) 

However, it also disappears too fast. And I don't know the reason. Does anyone have any suggestions?

Thank you in advance.

1
  • @Matthew Plourde do you have any suggestions? thanks Commented Feb 23, 2016 at 1:24

1 Answer 1

2

You may interested in withProgress i used this method in several app for big data loadings and long computations.

I used data loading in server function as:

stockdata<-withProgress(expr = {readRDS("sample.RDS")}
                        ,message = "Loading... Please wait")

http://shiny.rstudio.com/articles/progress.html

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your answer. Could you please explain more about how you used withProgress to wrap those big data loadings? Isn't it be outside the server function? Appreciate if you could share some sample codes.
@Z.Zhang i have added the lines i used
thanks so so so much for your help. that's what I am looking for for a long time
could you please take a look this question? wondering if you have experience with it.stackoverflow.com/questions/35664657/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.