Hi,
I developed a reporting app with shiny for my hospital.
I am not a programmer, I am a hand surgeon
Everything runs fine, no with the new year I want to switch between old year( Last period) and new year (actual period) in the same app.
Calculations and plots for a period always include actual year and previous year. 2017 and 2018 for 2018, 2018 and 2019 for 2019
There are a lot of calculations and variables done outside the main app. I put all data-frames and variables in two lists. Consequently there are two lists with calculations for 2018, y_prev ( with data from 2018 and 2017) and 2019 , y_pres (data from 2019 and 2018).
I load one list and from the list the variables and data frames are set
fall <- y_pres$fall. ### data frame
df.amb <- y_pres$df.amb ## data frame
df.klinik <- y_pres$df.klinik
df.stat <- y_pres$df.stat
bmon <- y_pres$bmon ## variable
br <- y_pres$br ## variable
off <- y_pres$off. ## data frame
solist <- y_pres$solist
akt_jahr <- y_pres$j[3]
vor_jahr <- y_pres$j[2]
coln_vor <- paste("J",vor_jahr,sep="")
coln_akt <- paste("J",akt_jahr,sep="")
col_tabs <- c("variable", coln_vor, coln_akt)
Now I defined two action buttons
actionButton("alt","Vorjahr"),
actionButton("akt","Aktuell")
and I want to switch between those two lists and change the values of the variables depending on the list.
How do I achieve this ?
Any other idea how to change variables and data frames for the visualization of the different periods ?
Thanks.
Peter