Skip to content

Commit

Permalink
Join species IDs to fix dogfish
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed May 20, 2024
1 parent 8c50d20 commit e5c5b59
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/tidy-cpue-index.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ tidy_cpue_index <- function(dat, species_common,
), ]
names(dat) <- tolower(names(dat))

if (!"species_common_name" %in% names(dat)) {
dat <- inner_join(dat, gfplot::pbs_species, by = "species_code")
}

# if (!"species_common_name" %in% names(dat)) {
dat$species_common_name <- NULL
dat <- inner_join(dat, gfplot::pbs_species, by = "species_code")
# }
dat <- dat %>% mutate(year = lubridate::year(best_date))

# create possibly alternate starting date:
Expand Down Expand Up @@ -163,6 +163,8 @@ tidy_cpue_index <- function(dat, species_common,

# retain the data from our "fleet"
d_retained <- semi_join(catch, fleet, by = "vessel_registration_number")


if (return_raw_data) {
return(d_retained)
}
Expand Down

0 comments on commit e5c5b59

Please sign in to comment.