From 93b1462aa914a1463d26350b3fa154ef32a12e94 Mon Sep 17 00:00:00 2001 From: ecophilina Date: Tue, 10 Sep 2024 11:45:09 -0700 Subject: [PATCH] make robust to unrealistic 0 values for either length or weight --- R/split-by-sex-maturity.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/R/split-by-sex-maturity.R b/R/split-by-sex-maturity.R index 5d7e3e2..dc929e4 100644 --- a/R/split-by-sex-maturity.R +++ b/R/split-by-sex-maturity.R @@ -127,9 +127,12 @@ split_catch_by_sex <- function(survey_sets, fish, fish_lengths <- fish %>% ## when some surveys or sets of years lack maturity data, can we still get something from other surveys? - filter(survey_abbrev %in% survey) %>% - filter(year %in% years) %>% - filter(!is.na(length)) + filter(survey_abbrev %in% survey) |> + filter(year %in% years) |> + # filter(!is.na(length)) |> + # zero lengths and weights shouldn't be possible! but rex sole from mssm has some + filter(length > 0) |> + filter(weight > 0| is.na(weight)) # if (split_by_weight) {