Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zandjyo committed Feb 23, 2024
1 parent 6a25f8d commit 412a314
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Running_scenarios_Update.r
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

Do_AK_TIER_3_Scenarios <- function(DIR = "Model23.1.0.d/PROJ", CYR = 2023, SYR = 1977, SEXES = 1, FLEETS = 1, Scenario2 = 1,
S2_F = 0.4, s4_F = 0.75, do_fig = TRUE, do_mark=TRUE,URL="https://apps-afsc.fisheries.noaa.gov/Plan_Team/2022/EBSpcod.pdf",
pdf_tab=1, init_dir=" C:/Users/steve.barbeaux/Work/GitHub/AK_Scenarios_For_SS") {
pdf_tab=1, init_dir="C:/Users/steve.barbeaux/Work/GitHub/AK_Scenarios_For_SS") {

# Check if the specified directory exists
if (!dir.exists(DIR)) {
Expand All @@ -55,7 +55,7 @@ Do_AK_TIER_3_Scenarios <- function(DIR = "Model23.1.0.d/PROJ", CYR = 2023, SYR =


## Specify the libraries to load
libraries <- c("r4ss", "data.table", "ggplot2", "R.utils", "parallel", "doParallel", "foreach")
libraries <- c("r4ss", "data.table","dplyr","flextable", "ggplot2", "R.utils", "parallel", "doParallel", "foreach")

# Loop through the libraries and load them if they don't exist
for (lib in libraries) {
Expand All @@ -66,7 +66,7 @@ Do_AK_TIER_3_Scenarios <- function(DIR = "Model23.1.0.d/PROJ", CYR = 2023, SYR =
}

.DIR <- DIR
setwd(DIR) ## folder with converged model
setwd(DIR) ## folder with converged modelinit
scenario_1 <- SS_readforecast(file = "forecast.ss")
# # Define the list of scenarios

Expand Down Expand Up @@ -442,9 +442,10 @@ for (i in 1:length(scenarios_P)){
## create markdown tables for assessment
if(do_mark){
## if we create a library, this would need to change. For now need to make sure these function files are in the root directory.

source(paste0(init_dir,"/main_table.r"))
source(paste0(init_dir,"/exe_table.r"))
source(paste0(init_dir,"/get_pdf_tables.r"))
source(paste0(init_dir,"/get_pdf_table.r"))
source(paste0(init_dir,"/proj_tables.r"))

pdf_table<-get_pdf_tables(url=URL, page=1:10)
Expand Down

0 comments on commit 412a314

Please sign in to comment.