From a8a4db481b5315d2d942de32f79d6e4c3a33dc90 Mon Sep 17 00:00:00 2001 From: Holden Harris Date: Thu, 7 Nov 2024 16:55:20 -0500 Subject: [PATCH] Update names of Ecospace scenarios. Also checks to see file paths for the scenarios exist. --- Compare-multiple-ecospace-outputs.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Compare-multiple-ecospace-outputs.R b/Compare-multiple-ecospace-outputs.R index cc3a10b..fd82ed7 100644 --- a/Compare-multiple-ecospace-outputs.R +++ b/Compare-multiple-ecospace-outputs.R @@ -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 @@ -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 @@ -486,7 +493,6 @@ sub_file_name_xM = paste0(dir_pdf_out, sub_plot_name_xM) } dev.off() - ## ----------------------------------------------------------------------------- ## ## Plot by month (xM)