Skip to content

Commit

Permalink
load update
Browse files Browse the repository at this point in the history
  • Loading branch information
tymjackson committed Oct 15, 2024
1 parent 2ed55c6 commit f99f864
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/load_crab_dump.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ load_crab_dump <- function(path, stock, database_pull = F, clean = T) {
fishery = ifelse(fishery == "OB08" & longitude < -174, "RB08", fishery),
fishery = gsub("XE", "OB", fishery),
fishery = paste0(substring(fishery, 1, 2), substring(crab_year, 3, 4))) %>%
mutate(fishery = ifelse(subdistrict == "EAG", gsub("RB", "OB", fishery),
ifelse(subdistrict == "WAG", gsub("OB", "RB", fishery), fishery))) %>%
# fill in legal
add_legal(., stock = stock) %>%
# add regulatory group
Expand Down
4 changes: 3 additions & 1 deletion R/load_dockside.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ load_dockside <- function(path, stock, database_pull = F, clean = T) {
(crab_year == 2008 & adfg %in% c(35767, 37887)) ~ "WAG",
(crab_year == 2008 & adfg %in% c(103, 5992, 20556)) ~ "EAG",
(crab_year == 2008 & adfg == 5992 & sample_date > as_date("2008-12-1")) ~ "WAG")) %>%
mutate(fishery = paste0(substring(fishery, 1, 2), substring(crab_year, 3, 4))) -> out
mutate(fishery = paste0(substring(fishery, 1, 2), substring(crab_year, 3, 4))) %>%
mutate(fishery = ifelse(subdistrict == "EAG", gsub("RB", "OB", fishery),
ifelse(subdistrict == "WAG", gsub("OB", "RB", fishery), fishery))) -> out
}
if(stock == "EAG"){
out %>%
Expand Down
2 changes: 2 additions & 0 deletions R/load_pot_dump.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ load_pot_dump <- function(path, stock, database_pull = F, clean = T) {
fishery = ifelse(fishery == "OB08" & longitude < -174, "RB08", fishery),
fishery = gsub("XE", "OB", fishery),
fishery = paste0(substring(fishery, 1, 2), substring(crab_year, 3, 4))) %>%
mutate(fishery = ifelse(subdistrict == "EAG", gsub("RB", "OB", fishery),
ifelse(subdistrict == "WAG", gsub("OB", "RB", fishery), fishery))) %>%
# remove pots without district info
filter(subdistrict != "-") -> out
}
Expand Down

0 comments on commit f99f864

Please sign in to comment.