M.Qasim
M.Qasim

Reputation: 1878

Refreshing shiny dataset

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.

Upvotes: 3

Views: 1877

Answers (2)

Dogan Askan
Dogan Askan

Reputation: 1228

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.

Upvotes: 4

Eva
Eva

Reputation: 36

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.

Upvotes: 2

Related Questions