From 52d956600ec24d5eccb6945db6e80b8ad5d27f8c Mon Sep 17 00:00:00 2001 From: Stephanie Pennington Date: Wed, 5 Jun 2024 17:47:32 -0400 Subject: [PATCH] Concat ssps used in txt file --- inst/shinyApp/components/modules/mod_run.R | 8 +++++++- inst/shinyApp/global.r | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/inst/shinyApp/components/modules/mod_run.R b/inst/shinyApp/components/modules/mod_run.R index d2edbac..12fee0f 100644 --- a/inst/shinyApp/components/modules/mod_run.R +++ b/inst/shinyApp/components/modules/mod_run.R @@ -194,9 +194,15 @@ run_server <- function(id, r6) { if(!is.null(r6$output)) { + ssp_names <- list() + for(i in 1:length(input$ssp_path)) { + ssp_names[[i]] <- names(which(scenarios == input$ssp_path[i], arr.ind = FALSE)) + } + names <- paste(unlist(ssp_names), collapse = ', ') + header_text <- paste0("File created with Hector UI - https://github.com/JGCRI/hector-ui accessed on ", format(Sys.time(), "%Y-%m-%d %X"), "\n", "Hector Version: ", packageVersion("hector"), "\n", - "SSPs Used: ", names(which(scenarios == input$ssp_path, arr.ind = FALSE)), "\n", + "SSPs Used: ", names, "\n", "Permafrost: ", r6$permafrost, "\n", "Model Parameters: " , input$input_paramToggle , "\n", "Alpha: ", input$alpha, "\n", diff --git a/inst/shinyApp/global.r b/inst/shinyApp/global.r index caab001..04a2d20 100644 --- a/inst/shinyApp/global.r +++ b/inst/shinyApp/global.r @@ -22,9 +22,6 @@ source("components/modules/mod_tracking.R", local = TRUE) source("components/functions/func_graph_plots.R", local = TRUE) source("components/functions/func_custom_emissions.R", local = TRUE) -scenarios <- get_scenarios() -title <- get_titles() - theme_set(theme_minimal()) # Define R6 class @@ -123,3 +120,5 @@ get_titles <- function() { return(title) } +scenarios <- get_scenarios() +title <- get_titles()