I'm trying to create a shiny app that allows a user to download a report with the latest figures, however inorder to calculate these latest figure, the user must upload an excel file.
What I would like to do is, after the user uploads the - save the different sheets as dataframes in the R environment because there are scricpts that need to run in order to make the calculations however, theres scripts are depended on the dataframe that need to be generated from the excel file.
Here is how I was doing it in the server.R file, but its not working.
mb_cma_generate is an action that I have, when the user clicks the button after uploading then the dataframes should generates in the environment, then the other scripts will be able to run.
Would appreciate any assistance
server <- function(input, output, session) {
data_mb_cma <- reactiveVal()
observeEvent(input$mb_cma_generate, {
# source("Data_prep.R", local = sys.frame(which = 1))
data_mb_cma$e_currency <- e_currency
data_mb_cma$N_currency <- N_currency
data_mb_cma$L_currency <- L_currency
data_mb_cma$e_averages <- e_averages
data_mb_cma$N_averages <- N_averages
data_mb_cma$L_averages <- L_averages
data_mb_cma$MTBPS <- MTBPS
data_mb_cma$MTBPS2 <- MTBPS2
source("cma_rmt.R", local = sys.frame(which = 1))
# source("Data_prep.R", local = T)
source("cma_projections.R", local = sys.frame(which = 1))
source("cma_calculations.R", local = sys.frame(which = 1))
source("cma_text.R", local = sys.frame(which = 1))
source("cma_params.R", local = sys.frame(which = 1))
source("cma_tables.R", local = sys.frame(which = 1))
})
}