My shiny app relies on a main CSV dataframe from which users pick whatever variable they want to feed charts, maps, etc. I now want users to be able to create new variables by combining existing variables.
Problem: I need the new variables to be stored in that main CSV dataframe along all the other variables, and make them available just for the session, for every other control/map/chart. Of course I can't just append the new variable to my CSV dataframe because it's not a reactive object.
So I'm naturally thinking of turning the CSV dataframe into a reactive object on start.
I tried
reactivedf<- reactiveVal()
reactivedf(df)
But for some reason this approach doesn't work, in the sense that when the app starts, all the charts and maps are empty.
However, the reactive object does "wakes up" with a eventReactive statement that updates the reactivedf, and the maps and charts come to life:
reactivedf <- eventReactive(input$button, {
<code to create a new variable and append it to reactivedf>
}
How can I make the reactivedf fully available on start?