Skip to content

Commit f9f1694

Browse files
Added file versions to modified path strings
1 parent 6ed7cbb commit f9f1694

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

analyses/monitoring_costs/monitoring_costs.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ ADP_dribble <- gdrive_set_dribble("Projects/ADP/source_data")
4444
#' Load the outputs of `get_data.R`
4545
adp_data.path <- paste0("source_data/", adp_year, "_", adp_ver, "_ADP_data.rdata")
4646
gdrive_download(local_path = adp_data.path, gdrive_dribble = ADP_dribble, ver = 8)
47-
adp_data.objects <- (load(adp_data.path))
47+
adp_data.objects <- (load(sub(".rdata", "_v008.rdata", adp_data.path)))
4848
# Keep only what is needed
4949
rm("adp_data.path", "adp_data.objects", list = setdiff(c(adp_data.objects), c("work.data.recent", "max_date", "trw_em")))
5050

5151
#'Load billable days for actual plant days, created in `get_data.R`
5252
gdrive_download("source_data/ais_billable_days.Rdata", ADP_dribble, ver = 8)
53-
(load("source_data/ais_billable_days.Rdata"))
53+
(load("source_data/ais_billable_days_v008.Rdata"))
5454

5555
#' Load the outputs of `trip_duration.R`
5656
trip_data.path <- paste0("source_data/trip_duration_", adp_year, "_", adp_ver, ".rdata")
5757
gdrive_download(local_path = trip_data.path, gdrive_dribble = ADP_dribble, ver = 3)
58-
(load(trip_data.path))
58+
(load(sub(".rdata", "_v003.rdata", trip_data.path)))
5959

6060
#====================#
6161
### FMA Days Paid ----
@@ -76,7 +76,7 @@ FMA_days_paid <- lapply(read_xl_allsheets("analyses/monitoring_costs/FMA Days Pa
7676
#' The 'current' year is the year before `adp_year`, i.e., the year we are currently in as we plan for the next year.
7777
prior_adp_results.path <- paste0("results/", adp_year - 1, "_Final_ADP_results.rdata")
7878
gdrive_download(local_path = prior_adp_results.path , gdrive_set_dribble("Projects/ADP/Output/"), ver = 6)
79-
current_adp_items <- (load(prior_adp_results.path))
79+
current_adp_items <- (load(sub(".rdata", "_v006.rdata", prior_adp_results.path)))
8080
# Remove everything added aside from the ADP rates
8181
rm("prior_adp_results.path", list = setdiff(current_adp_items, c("rates_adp")))
8282

analyses/trip_duration/trip_duration.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ gdrive_download(
2020
gdrive_dribble = gdrive_set_dribble("Projects/ADP/source_data/"),
2121
ver = 8
2222
)
23-
adp_data.objects <- (load(adp_data.path))
23+
adp_data.objects <- (load(sub(".rdata", "_v008.rdata", adp_data.path)))
2424

2525
# Cleanup all but the absolutely necessary inputs
2626
rm(adp_data.objects, list = setdiff(adp_data.objects,

selection_rates.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gdrive_download(
3737
gdrive_dribble = gdrive_set_dribble("Projects/ADP/source_data/"),
3838
ver = 8
3939
)
40-
(load(adp_data.path))
40+
(load(sub(".rdata", "_v008.rdata", adp_data.path)))
4141

4242
#' Load the outputs of `trip_duration.R`
4343
trip_data.path <- paste0("source_data/trip_duration_", adp_year, "_", adp_ver, ".rdata")
@@ -46,7 +46,7 @@ gdrive_download(
4646
gdrive_dribble = gdrive_set_dribble("Projects/ADP/source_data/"),
4747
ver = 3
4848
)
49-
(load(trip_data.path))
49+
(load(sub(".rdata", "_v003.rdata", trip_data.path)))
5050

5151
#' Load `cost_params`, the output of `analyses/monitoring_costs.R`.
5252
cost_param.path <- paste0("source_data/cost_params_", adp_year, ".Rdata")
@@ -56,7 +56,7 @@ if(file.exists(cost_param.path)) {
5656
gdrive_dribble = gdrive_set_dribble("Projects/ADP/Monitoring Costs - CONFIDENTIAL/"),
5757
ver = 7
5858
)
59-
(load(cost_param.path))
59+
(load(sub(".rdata", "_v007.rdata", cost_param.path)))
6060

6161
#' Using `fg_em` from `get_data.R`, add the number of fixed-gear EM vessels to the `cost_params` list
6262
cost_params$EMFG$emfg_v <- uniqueN(fg_em[FLAG %in% c("A", "NONE"), PERMIT])
@@ -72,7 +72,7 @@ if(adp_ver == "Final") {
7272
gdrive_dribble = gdrive_set_dribble("Projects/ADP/source_data/"),
7373
ver = 4
7474
)
75-
(load(effort_prediction.path))
75+
(load(sub(".rdata", "_v004.rdata", effort_prediction.path)))
7676
}
7777

7878
# Load the ADFG statistical area shapefile.
@@ -513,7 +513,7 @@ if(adp_ver == "Draft") {
513513
gdrive_dribble = gdrive_set_dribble("Projects/ADP/Output"),
514514
ver = 5 # 2026 Draft ADP
515515
)
516-
(load(draft_tables_name))
516+
(load(sub(".rdata", "_v005.rdata", draft_tables_name)))
517517
table_b1.draft <- copy(table_b1)
518518
table_b2.draft <- copy(table_b2)
519519
table_b3.draft <- copy(table_b3)

0 commit comments

Comments
 (0)