From d1c4491b389c792f46284354a76e9e458e6752be Mon Sep 17 00:00:00 2001 From: Turner Date: Mon, 17 Jun 2024 15:05:07 -0400 Subject: [PATCH] move Jackson fix inside watershed mapping --- R/count_watershed_data.R | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/R/count_watershed_data.R b/R/count_watershed_data.R index ccf1d13..704818a 100644 --- a/R/count_watershed_data.R +++ b/R/count_watershed_data.R @@ -141,10 +141,6 @@ count_watershed_data <- function(data_dir, # read in NHD flow shapefile import_shapefile(file.path(data_dir, file_paths["nhd_flow"])) %>% st_as_sf() -> watershed_nhd_flows - # temporary fix for Jackson MS - if(watersheds == 3743){ - runoff_totals <- get_watershed_ts(3683) %>% mutate(watershed = 3743) - } # map through all cities, computing teleconnections watersheds %>% @@ -224,6 +220,13 @@ count_watershed_data <- function(data_dir, #------------------------------------------------------- # TELECONNECTION - WATERSHED RUNOFF AND FLOW VALUES + + # temporary fix for Jackson MS + if(watershed == 3743){ + runoff_totals <- get_watershed_ts(3683) %>% + mutate(watershed = 3743) + } + runoff_totals %>% filter(watershed == !!watershed) -> watershed_runoff