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 6fef05d commit 8180815
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions R/load_crab_dump.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ load_crab_dump <- function(path, stock, database_pull = F, clean = T) {
if(stock %in% c("AIGKC", "EAG", "WAG")) {
## data mgmt specific to gkc
out %>%
# make XE fisheries EAG
mutate(subdistrict = ifelse(substring(fishery, 1, 2) == "XE", "EAG", subdistrict),
clean_lat_lon() %>%
mutate(subdistrict = ifelse(fishery == "OB08" & longitude < -174, "WAG", subdistrict),
subdistrict = ifelse(substring(fishery, 1, 2) == "XE", "EAG", subdistrict),
fishery = ifelse(fishery == "OB08" & longitude < -174, "RB08", fishery),
fishery = gsub("XE", "OB", fishery),
fishery = paste0(substring(fishery, 1, 2), substring(crab_year, 3, 4))) %>%
# fill in legal
add_legal(., stock = stock) %>%
Expand Down
6 changes: 5 additions & 1 deletion R/load_pot_dump.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ load_pot_dump <- function(path, stock, database_pull = F, clean = T) {
## data mgmt specific to gkc
out %>%
clean_lat_lon() %>%
mutate(subdistrict = ifelse(fishery == "OB08" & longitude < -174, "WAG", subdistrict)) %>%
mutate(subdistrict = ifelse(fishery == "OB08" & longitude < -174, "WAG", subdistrict),
subdistrict = ifelse(substring(fishery, 1, 2) == "XE", "EAG", subdistrict),
fishery = ifelse(fishery == "OB08" & longitude < -174, "RB08", fishery),
fishery = gsub("XE", "OB", fishery),
fishery = paste0(substring(fishery, 1, 2), substring(crab_year, 3, 4))) %>%
# remove pots without district info
filter(subdistrict != "-") -> out
}
Expand Down

0 comments on commit 8180815

Please sign in to comment.