3

I have update my DataSet.RData used by my shiny app running on Shiny Server. However, shiny app is still running on the old data. I have cleared by browser history and restarted the browser a couple of times but no success.

When I run app within RStudio, it runs fine and shows the new data.

M.Qasim
  • 1,827
  • 4
  • 33
  • 58

2 Answers2

3

If you create/edit a file called restart.txt in your app folder the server restarts the application. To do so, you can add a button to create/edit that file like,

# ui.R
actionButton("restart", "Restart")

# server.R
observeEvent(input$restart, {
    file.create("restart.txt")
})

After clicking this button and refresh the page your data should also be refreshed.

Dogan Askan
  • 1,160
  • 9
  • 22
2

Probably you found the answer to this question already. When you refresh the page in the browser server and ui are restarted. However, global is not. So if you load the data in the global, the data is not reloaded when you refresh.

Solution: Restart the app on the Shiny Server.

Eva
  • 36
  • 3
  • Thanks Eva. Is it possible to add to click button to refresh the data without refreshing the whole page? – M.Qasim Oct 22 '15 at 19:13
  • Yes it is. However, just reloading the data does not work. You should put the data in an reactiveValues-object. In that way everything that is using this data will refresh. – Eva Oct 23 '15 at 21:03