diff --git a/R/tidy-cpue-index.R b/R/tidy-cpue-index.R index 85f0bfc..ac70991 100644 --- a/R/tidy-cpue-index.R +++ b/R/tidy-cpue-index.R @@ -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: @@ -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) }