Skip to content

Commit

Permalink
Update names of Ecospace scenarios. Also checks to see file paths for…
Browse files Browse the repository at this point in the history
… the scenarios exist.
  • Loading branch information
Holden Harris authored and Holden Harris committed Nov 7, 2024
1 parent 2851501 commit a8a4db4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Compare-multiple-ecospace-outputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ experiment_choice <- 1 # Set to 1 for Experiment 1, or 2 for Experiment 2
if (experiment_choice == 1) {
## Experiment 1 --------------------------------------------------------------
## Compares scenarios with piece-wise environmental drivers
spa_scenarios = c("spa_ST00_base-no-drivers", "spa_ST01a_surf-sal",
"spa_ST01b_temp", "spa_ST01c_PP-MODIS")
spa_scenarios = c("exp1_01_base-no-drivers", "exp1_02_sal",
"exp1_03_temp", "exp1_04_PP-MODIS")
spa_scen_names = c("01 No drivers", "02 Salinity",
"03 Temperature", "04 PP (MODIS)")
out_file_notes = "test-STEdrivers" ## label outputs
Expand All @@ -46,6 +46,13 @@ if (experiment_choice == 1) {
col_spa <- c("goldenrod", "darkorchid3", "deeppink", "blue")
}

## Check if the files for the scenarios exist
for (i in 1:length(spa_scenarios)) {
dir_spa <- paste0("./", ewe_name, "/", spa_scenarios[i], "/")
if (dir.exists(dir_spa)) print(paste0("Directory exists: ", dir_spa))
else message("Directory does NOT exist: ", dir_spa)
}

## Create the output folder if it doesn't exist
if (!dir.exists(dir_out)) {
dir.create(dir_out, recursive = TRUE) ## Create the folder if it doesn't exist
Expand Down Expand Up @@ -486,7 +493,6 @@ sub_file_name_xM = paste0(dir_pdf_out, sub_plot_name_xM)
}
dev.off()


## -----------------------------------------------------------------------------
##
## Plot by month (xM)
Expand Down

0 comments on commit a8a4db4

Please sign in to comment.