From 595338a05c9c1912a3a52f9a23078ac7998153b4 Mon Sep 17 00:00:00 2001 From: milesmedina <44986194+milesmedina@users.noreply.github.com> Date: Wed, 8 May 2024 13:00:36 -0400 Subject: [PATCH] adding site subsetting functionality --- R/logistic.R | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/R/logistic.R b/R/logistic.R index 66d8778..8a5da85 100644 --- a/R/logistic.R +++ b/R/logistic.R @@ -21,7 +21,8 @@ logim <- function( wqdat, loaddat, plot = TRUE ){ # join wq and load data - wqsub <- wqdat |> + wqsub <- wqdat[ which( wqdat$site %in% wqloc ), ] + wqsub <- wqsub |> filter(param %in% c(y, x2)) |> dplyr::summarise( value = mean(value, na.rm = TRUE ), @@ -138,12 +139,23 @@ load(file = here::here('data/loads.RData')) mod.turb <- logim( wqdat = epcwq3, loaddat = loads, y = "Chla", x1 = "TN load", x2 = "Turbidity", ytarget = 9.3, xtarget = c(40), - qnt = c(0.95), wqloc = unique(epcwq3$site) ) + qnt = c(0.95), + wqloc = unique(epcwq3$site) ) + # wqloc = c(46,64) ) # NW + # wqloc = c(42,65,66) ) # CW + # wqloc = c(40,41,61,63) ) # CE mod.sal <- logim( wqdat = epcwq3, loaddat = loads, y = "Chla", x1 = "TN load", x2 = "Sal_top", ytarget = 9.3, xtarget = c(40), - qnt = c(0.95), wqloc = unique(epcwq3$site) ) + qnt = c(0.95), + wqloc = unique(epcwq3$site) ) + # wqloc = c(46,64) ) # NW + # wqloc = c(47,60,62) ) # NE + # wqloc = c(42,65,66) ) # CW + # wqloc = c(40,41,61,63) ) # CE + # wqloc = c(38,67,68) # SW + # wqloc = c(36,50,51) ) # SE mod.temp <- logim( wqdat = epcwq3, loaddat = loads, y = "Chla", x1 = "TN load", x2 = "Temp_top",