Skip to content

Commit

Permalink
fix(commit_catch)
Browse files Browse the repository at this point in the history
  • Loading branch information
kellijohnson-NOAA committed Dec 10, 2023
1 parent 783b483 commit bd209d0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions R/commit-.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,12 @@ commit_catch <- function(dir_data = hakedata_wd(),
sector == "ft" ~ "CAN_FreezeTrawl",
sector == "jv" ~ "CAN_JV"
)) %>%
tidyr::pivot_longer(
cols = !sector:Year,
names_to = "month"
) %>%
dplyr::group_by(Year, sector) %>%
dplyr::summarize(catch = sum(value)) %>%
dplyr::group_by(year, sector) %>%
dplyr::summarize(catch = sum(catch)) %>%
tidyr::pivot_wider(names_from = sector, values_from = catch) %>%
dplyr::mutate(
dplyr::across(dplyr::starts_with("CAN"), tidyr::replace_na, 0)
) %>%
dplyr::rename(year = Year)
)
inc <- list(sh, cp, ms, can) %>%
purrr::reduce(dplyr::full_join, by = "year") %>%
dplyr::rename(
Expand Down

0 comments on commit bd209d0

Please sign in to comment.