Skip to content

Commit

Permalink
Concat ssps used in txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
stephpenn1 committed Jun 5, 2024
1 parent 7bedc66 commit 52d9566
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion inst/shinyApp/components/modules/mod_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions inst/shinyApp/global.r
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -123,3 +120,5 @@ get_titles <- function() {
return(title)
}

scenarios <- get_scenarios()
title <- get_titles()

0 comments on commit 52d9566

Please sign in to comment.