'RShiny: Save State via RData File
I'm trying to save every table, chart, variable, dataframe, etc. in my application via an RData file. Is this possible? The "BookMark" functionality would require a massive code rework unfortunately or it would be my preferred option. Is this a case where I'd have to find the names of pretty much everything and create a list to save to the Rdata file? Or is there like a "Save all" option I could utilize.
Also, on load would a saved chart be created? Or would just the underlying data be saved and I'd have to trigger the chart to be made.
Long story short, I'm trying to save state in an RData file, and then reload that state on the load of the same Rdata file. I'm very new to RShiny so I apologize if I'm not wording things correctly here.
I've tried:
observeEvent(input$save_rdata, {
save(list = ls(all.names = TRUE), file = "image.RData", envir =
environment())
})
observeEvent(input$load_rdata, {
file <- "image.RData"
load(file)
print(var1())
print(var2())
})
I've also tried save.image method and I still can't get var1 and var2 to print out after closing the app, and trying to load the image.Rdata file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
