From 8d5efcd84207fd902a573d2066f90001eda221c4 Mon Sep 17 00:00:00 2001 From: fawda123 Date: Thu, 10 Oct 2024 13:42:06 -0400 Subject: [PATCH] update anlz_fibmatrix to remove groups with years less than lagyr --- DESCRIPTION | 2 +- R/anlz_fibmatrix.R | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6766cd65..76be7c9f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tbeptools Title: Data and Indicators for the Tampa Bay Estuary Program Version: 3.0.0.9000 -Date: 2024-09-30 +Date: 2024-10-10 Authors@R: c( person(given = "Marcus", family = "Beck", diff --git a/R/anlz_fibmatrix.R b/R/anlz_fibmatrix.R index ae0fa6d0..e5208802 100644 --- a/R/anlz_fibmatrix.R +++ b/R/anlz_fibmatrix.R @@ -224,6 +224,10 @@ anlz_fibmatrix <- function(fibdata, yrrng = NULL, stas = NULL, bay_segment = NUL .by = c('grp', 'yr') ) %>% dplyr::arrange(grp, yr) %>% + dplyr::filter( + length(unique(yr)) >= lagyr, + .by = 'grp' + ) %>% dplyr::mutate( sumgt = stats::filter(sumgt, rep(1, lagyr), sides = 1, method = 'convolution'), tot = stats::filter(tot, rep(1, lagyr), sides = 1, method = 'convolution'),