Skip to content

Commit

Permalink
reworked get_effort_landings to ensure other fleet has species codes …
Browse files Browse the repository at this point in the history
…defined
  • Loading branch information
andybeet committed Sep 3, 2024
1 parent 2b39c8d commit 06b6219
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/get_effort_landings.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,20 @@ get_effort_landings <- function(fleetData,ports,combine,speciesCodes) {
dplyr::mutate(Box = as.numeric(Box)) |>
dplyr::filter(!(PORTID %in% ports),
Code %in% speciesCodes) |>
dplyr::group_by(Year,Box) |>
dplyr::group_by(Year,Box,Code) |>
dplyr::summarise(landings = sum(InsideLANDED),
.groups = "drop") |>
dplyr::mutate(PID = NA,
newport = "OTHER",
STATEABB = "NA",
Code = "NA") |>
dplyr::relocate(Year,Box,PID,landings,newport,STATEABB)
STATEABB = "NA") |>
dplyr::relocate(Year,Box,PID,Code,landings,newport,STATEABB)


portNames <- fleets |>
dplyr::distinct(newport,STATEABB,PORTID)

message("combining all data")
# now combine some of the fleets
# now combine some of the fleets (associated ports with main ports)
# relabel port ids
fleets$PID <- fleets$PORTID
das$PID <- das$PORTID
Expand Down

0 comments on commit 06b6219

Please sign in to comment.