Hello,
I have made a R script that reads in some data, does a lot of calculations on it, and then makes a map of it.
I want to make a Shiny app that does it automatically, where the user can load some csv-files and the calculations are done automatically. I am a newby, so I don't have a lot of experience with it
My problem here is that I am not sure how I have to update my data so everything works:
- I can read my data in, so that is not a problem
- in the server file, I am not sure how I should work. I need a reactive() code, because I use the data that has been put to the input. But should I put everything into the same reactive()? And how can I access the final data.frame that I need to make a map out? Or should I put everything in an output()?
migration_calc <- reactive ({
migration <- migration() #data that has been read
population= population() #data that has been read
# A lot of code to get to the final point
Local_scenario #endproduct
})
When I want to make an output map after this code (by applying output$map...), I get an error that Local_scenario does not exist.