diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..afb129a --- /dev/null +++ b/.gitignore @@ -0,0 +1,52 @@ +# History files +.Rhistory +.Rapp.history + +# Session Data files +.RData +.RDataTmp + +# User-specific files +.Ruserdata + +# Example code in package build process +*-Ex.R + +# Output files from R CMD build +/*.tar.gz + +# Output files from R CMD check +/*.Rcheck/ + +# RStudio files +.Rproj.user/ + +# produced vignettes +vignettes/*.html +vignettes/*.pdf + +# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 +.httr-oauth + +# knitr and R markdown default cache directories +*_cache/ +/cache/ + +# Temporary files created by R markdown +*.utf8.md +*.knit.md + +# R Environment Variables +.Renviron + +# pkgdown site +docs/ + +# translation temp files +po/*~ + +# RStudio Connect folder +rsconnect/ + +# Mac only Finder files +.DS_Store diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..3ffb6bf --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,65 @@ +# This CITATION.cff file was generated with cffinit. +# Visit https://bit.ly/cffinit to generate yours today! + +cff-version: 1.2.0 +title: mill-creek +message: >- + If you use this software, please cite it using the + metadata from this file. +type: software +authors: + - affiliation: >- + University of Guelph, Department of Integrative + Biology + given-names: Koya + family-names: Basso + orcid: 'https://orcid.org/0009-0002-5641-8695' + - given-names: Braden + family-names: Fallon + affiliation: >- + University of Guelph, Department of Integrative + Biology + - given-names: Morgan + family-names: Humphrey + affiliation: >- + University of Guelph, Department of Integrative + Biology + orcid: 'https://orcid.org/0009-0006-5363-1369' + - given-names: Hanna + family-names: Novaes + affiliation: >- + University of Guelph, Department of Integrative + Biology + - given-names: Emma + family-names: Tamburro + affiliation: >- + University of Guelph, Department of Integrative + Biology + - given-names: Sveta + family-names: Uzhova + affiliation: >- + University of Guelph, Department of Integrative + Biology + - given-names: Janna + family-names: Wardell + affiliation: >- + University of Guelph, Department of Integrative + Biology + - given-names: Robert + family-names: Hanner + affiliation: >- + University of Guelph, Department of Integrative + Biology + orcid: 'https://orcid.org/0000-0003-0703-1646' +repository-code: >- + https://github.com/uofg-biodiversity-capstone-2024/mill-creek +url: >- + https://github.com/uofg-biodiversity-capstone-2024/mill-creek/blob/main/README.md +keywords: + - Biodiversity + - Conservation + - Restoration + - Subwatershed + - Mann-Kendall tests + - Regression +license: BSD-2-Clause diff --git a/README.md b/README.md index 817f6b8..f6d4738 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,42 @@ # mill-creek -Code and data for the "Biodiversity, cumulative effects, and the future of restoration in the Mill Creek Subwatershed" report + +## Overview +This repository hosts compiled data and analysis code for the report, "Biodiversity, cumulative effects, and the future of restoration in the Mill Creek Subwatershed," written by the University of Guelph BSc. Biodiversity Capstone Class of 2024 on behalf of the [Friends of Mill Creek (FoMC)](https://www.friendsofmillcreek.org/membership/sub-page-top/) community organization, with collaboration from the [Grand River Conservation Authority (GRCA)](https://www.grandriver.ca/). + +## Data sources +Continuous data was sourced from the [GRCA Data Downloads](https://data.grandriver.ca/downloads-monitoring.html), including: +- water temperature (Aberfoyle and Side Road 10) +- water flow (Aberfoyle and Side Road 10) +- air temperature (Cambridge Shade's Mills) +- precipitation (Cambridge Shade's Mills) + +Other abiotic data was sourced from GRCA document archives and publicly available monitoring reports. Surface water quality data was sourced from the [Government of Ontario's Provincial Water Quality Monitoring Network (PWQMN)](https://data.ontario.ca/en/dataset/provincial-stream-water-quality-monitoring-network) grab sample dataset (Side Road 10, collection site ID 16018413102). Friends of Mill Creek Stewardship Ranger data was sourced from compiled ranger reports. Biotic data was sourced from the [STREAM project](https://stream-dna.org/), GRCA document archives, and publicly available records. + +## Organization +Scripts are located under the `code` folder. This includes: +- `air_temp.R` (summary analysis) +- `precip.R` (summary analysis) +- `water_temp.R` (summary analysis) +- `water_flow.R` (summary analysis) +- `mk_tests.R` (Mann-Kendall testing) +- `regressions.R` (regression modelling) +- `abiotic_graphing.R` (water quality, air temp, precipitation, water temp, and ranger restoration graphs) +- `biotic_graphing.R` (biotic inventory, STREAM, and trout graphs) + +Data `.csv` and `.xlsx` files are organized under the `data` folder, with different sub-folders. All GRCA continuous monitoring data is represented by a raw data file, metadata file, and summarized data file with average metrics. Output figures are included under the `figures` folder, with different sub-folders. The supplemental material folder includes all supplemental documents for the capstone report, including the report itself. + +## Running the code +All code for this repository was written in the R language, which is used to manipulate our data sets, describe the data, perform statistical analyses, and produce graphs. To run the code, clone the repo and open the `mill-creek.Rproj` file in R or RStudio. All required package installation and library code is included at the top of each script. + +## Example figures +![biotic inventory classes](figures/biotic_inventory/classes.png) +Proportion of entries in the ongoing biodiversity inventory, by Animal Class. The dashed vertical line separates vertebrate (Chordata) and invertebrate (outside Chordata) Classes. + +![ranger restoration](figures/ranger_restoration_activities.png) +Type of restoration work completed by the Mill Creek Stewardship Rangers over the years, by frequency. + +![flashiness MK](figures/mann-kendall/MK_annual_flashiness.png) +Annual flashiness index values at the Aberfoyle (left) and Side Road 10 (right) gauge stations. + +![water temp regression](figures/regression/water_by_air_temp.png) +Daily average water temperature (C) at the Side Road 10 gauge station as a function of daily average air temperature (C) at the Cambridge Shade’s Mills Climate Station. \ No newline at end of file diff --git a/code/abiotic_graphing.R b/code/abiotic_graphing.R new file mode 100644 index 0000000..fa2ead7 --- /dev/null +++ b/code/abiotic_graphing.R @@ -0,0 +1,412 @@ +### ABIOTIC GRAPHING + +## Load packages --------------------------------------------------------------- +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(lubridate, quietly = TRUE)) { + install.packages("lubridate") + library(lubridate)} + +## Import data ----------------------------------------------------------------- +# PWQMN data +ammonium <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Ammonium") # ammonium +View(ammonium) + +chloride <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Chloride") # chloride +View(chloride) + +conductivity <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Conductivity") # conductivity +View(conductivity) + +dissolved_oxygen <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Dissolved Oxygen") # dissolved oxygen +View(dissolved_oxygen) + +nitrate <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Nitrate") # nitrate +View(nitrate) + +nitrite <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Nitrite") # nitrite +View(nitrite) + +ph <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "pH") # pH +View(ph) + +phosphate <- read_excel("./data/water_quality/PWQMN_Mill_Creek_Data.xlsx", sheet = "Phosphate") # phosphate +View(phosphate) + +# Most extreme years +air_temp_summarized <- read.csv("data/air_temp/CSM_summarized_air_temp.csv") # air temperature - all years summarized +View(air_temp_summarized) + +ABF_water_temp_summarized <- read.csv("data/water_temp/ABF_summarized_water_temp.csv") # Aberfoyle water temperature - all years summarized +View(ABF_water_temp_summarized) + +SR10_water_temp_summarized <- read.csv("data/water_temp/SR10_summarized_water_temp.csv") # Side Road 10 water temperature - all years summarized +View(SR10_water_temp_summarized) + +precip_summarized <- read.csv("data/precipitation/CSM_summarized_precip.csv") # precipitation - all years summarized +View(precip_summarized) + +# Rangers Restoration data +ranger_activities <- read.csv("data/Ranger_restoration_activities.csv", header=TRUE) # restoration activities by type +View(ranger_activities) + +ranger_sites <- read.csv("data/Ranger_work_sites.csv", header=TRUE) # restoration work sites +View(ranger_sites) + +## Data prep ------------------------------------------------------------------- +# PWQMN data +ammonium$Collection_Date <- as.Date(ammonium$`Collection Timestamp`) +View(ammonium) + +chloride$Collection_Date <- as.Date(chloride$`Collection Timestamp`) +View(chloride) + +conductivity$Collection_Date <- as.Date(conductivity$`Collection Timestamp`) +View(conductivity) + +dissolved_oxygen$Collection_Date <- as.Date(dissolved_oxygen$`Collection Timestamp`) +View(dissolved_oxygen) + +nitrate$Collection_Date <- as.Date(nitrate$`Collection Timestamp`) +View(nitrate) + +nitrite$Collection_Date <- as.Date(nitrite$`Collection Timestamp`) +View(nitrite) + +phosphate$Collection_Date <- as.Date(phosphate$`Collection Timestamp`) +View(phosphate) + +ph$Collection_Date <- as.Date(ph$`Collection Timestamp`) +View(ph) + +# Most extreme years +# Air temperature +air_temp_summarized$Month <- month.abb[air_temp_summarized$Month] # give months abbreviated names +air_temp_summarized$Month <- factor(air_temp_summarized$Month, levels = month.abb) # convert month to a factor +View(air_temp_summarized) + +air_temp_2002 <- subset(air_temp_summarized, Year == 2002) # select 2002 data +air_temp_2005 <- subset(air_temp_summarized, Year == 2005) # select 2005 data +air_temp_2009 <- subset(air_temp_summarized, Year == 2009) # select 2009 data +air_temp_2011 <- subset(air_temp_summarized, Year == 2011) # select 2011 data +air_temp_2012 <- subset(air_temp_summarized, Year == 2012) # select 2012 data +air_temp_2014 <- subset(air_temp_summarized, Year == 2014) # select 2014 data +air_temp_2015 <- subset(air_temp_summarized, Year == 2015) # select 2015 data +air_temp_2020 <- subset(air_temp_summarized, Year == 2020) # select 2020 data + +air_temp_all_years <- bind_rows(air_temp_2002, air_temp_2005, air_temp_2009, air_temp_2011, air_temp_2012, air_temp_2014, air_temp_2015, air_temp_2020) +View(air_temp_all_years) + +# Water temperature - Aberfoyle station +ABF_water_temp_summarized$Month <- month.abb[ABF_water_temp_summarized$Month] # give months abbreviated names +ABF_water_temp_summarized$Month <- factor(ABF_water_temp_summarized$Month, levels = month.abb) # convert month to a factor +View(ABF_water_temp_summarized) + +ABF_high_water_temp_2005 <- subset(ABF_water_temp_summarized, Year == 2005) # select 2005 data - high temp +ABF_high_water_temp_2006 <- subset(ABF_water_temp_summarized, Year == 2006) # select 2006 data - high temp +ABF_high_water_temp_2011 <- subset(ABF_water_temp_summarized, Year == 2011) # select 2011 data - high temp +ABF_high_water_temp_2016 <- subset(ABF_water_temp_summarized, Year == 2016) # select 2016 data - high temp +ABF_high_water_temp_2019 <- subset(ABF_water_temp_summarized, Year == 2019) # select 2019 data - high temp + +ABF_high_water_temp_all_years <- bind_rows(ABF_high_water_temp_2005, ABF_high_water_temp_2006, ABF_high_water_temp_2011, ABF_high_water_temp_2016, ABF_high_water_temp_2019) +View(ABF_high_water_temp_all_years) + +ABF_low_water_temp_2005 <- subset(ABF_water_temp_summarized, Year == 2005) # select 2005 data - low temp +ABF_low_water_temp_2008 <- subset(ABF_water_temp_summarized, Year == 2008) # select 2008 data - low temp +ABF_low_water_temp_2009 <- subset(ABF_water_temp_summarized, Year == 2009) # select 2009 data - low temp +ABF_low_water_temp_2014 <- subset(ABF_water_temp_summarized, Year == 2014) # select 2014 data - low temp +ABF_low_water_temp_2019 <- subset(ABF_water_temp_summarized, Year == 2019) # select 2019 data - low temp + +ABF_low_water_temp_all_years <- bind_rows(ABF_low_water_temp_2005, ABF_low_water_temp_2008, ABF_low_water_temp_2009, ABF_low_water_temp_2014, ABF_low_water_temp_2019) +View(ABF_low_water_temp_all_years) + +# Water temperature - Side Road 10 station +SR10_water_temp_summarized$Month <- month.abb[SR10_water_temp_summarized$Month] # give months abbreviated names +SR10_water_temp_summarized$Month <- factor(SR10_water_temp_summarized$Month, levels = month.abb) # convert month to a factor +View(SR10_water_temp_summarized) + +SR10_high_water_temp_2001 <- subset(SR10_water_temp_summarized, Year == 2001) # select 2001 data - high temp +SR10_high_water_temp_2002 <- subset(SR10_water_temp_summarized, Year == 2002) # select 2002 data - high temp +SR10_high_water_temp_2012 <- subset(SR10_water_temp_summarized, Year == 2012) # select 2012 data - high temp +SR10_high_water_temp_2023 <- subset(SR10_water_temp_summarized, Year == 2023) # select 2023 data - high temp + +SR10_high_water_temp_all_years <- bind_rows(SR10_high_water_temp_2001, SR10_high_water_temp_2002, SR10_high_water_temp_2012, SR10_high_water_temp_2023) +View(SR10_high_water_temp_all_years) + +SR10_low_water_temp_2003 <- subset(SR10_water_temp_summarized, Year == 2003) # select 2003 data - low temp +SR10_low_water_temp_2018 <- subset(SR10_water_temp_summarized, Year == 2018) # select 2018 data - low temp +SR10_low_water_temp_2019 <- subset(SR10_water_temp_summarized, Year == 2019) # select 2019 data - low temp + +SR10_low_water_temp_all_years <- bind_rows(SR10_low_water_temp_2003, SR10_low_water_temp_2018, SR10_low_water_temp_2019) +View(SR10_low_water_temp_all_years) + +# Precipitation +precip_summarized$Month <- month.abb[precip_summarized$Month] # give months abbreviated names +precip_summarized$Month <- factor(precip_summarized$Month, levels = month.abb) # convert month to a factor +View(precip_summarized) + +high_precip_2006 <- subset(precip_summarized, Year == 2006) # select 2006 data - high precip year +high_precip_2008 <- subset(precip_summarized, Year == 2008) # select 2008 data - high precip year +high_precip_2016 <- subset(precip_summarized, Year == 2016) # select 2016 data - high precip year +high_precip_2019 <- subset(precip_summarized, Year == 2019) # select 2019 data - high precip year +high_precip_2023 <- subset(precip_summarized, Year == 2023) # select 2023 data - high precip year + +high_precip_years <- bind_rows(high_precip_2006, high_precip_2008, high_precip_2016, high_precip_2019, high_precip_2023) +View(high_precip_years) + +low_precip_2007 <- subset(precip_summarized, Year == 2007) # select 2007 data - low precip year +low_precip_2011 <- subset(precip_summarized, Year == 2011) # select 2011 data - low precip year +low_precip_2015 <- subset(precip_summarized, Year == 2015) # select 2015 data - low precip year +low_precip_2017 <- subset(precip_summarized, Year == 2017) # select 2017 data - low precip year +low_precip_2022 <- subset(precip_summarized, Year == 2022) # select 2022 data - low precip year + +low_precip_years <- bind_rows(low_precip_2007, low_precip_2011, low_precip_2015, low_precip_2017, low_precip_2022) +View(low_precip_years) + +# Rangers Restoration data +# Restoration methods +years_reported_activities <- ranger_activities %>% + distinct(Year,Restoration.Work.Performed) %>% + group_by(Restoration.Work.Performed)%>% + summarise(count=n()) + +years_reported_activities$Restoration.Work.Performed <- as.factor(years_reported_activities$Restoration.Work.Performed) +years_reported_activities$Restoration.Work.Performed <- factor(years_reported_activities$Restoration.Work.Performed, levels = years_reported_activities$Restoration.Work.Performed[order(years_reported_activities$count, decreasing = TRUE)]) + +#Restoration sites +years_reported_sites<-ranger_sites %>% + distinct(Year,Location) %>% + group_by(Location)%>% + summarise(count=n()) + +years_reported_sites$Location <- as.factor(years_reported_sites$Location) +years_reported_sites$Location <- factor(years_reported_sites$Location, levels = years_reported_sites$Location[order(years_reported_sites$count, decreasing = TRUE)]) + +# PWQMN graphs ----------------------------------------------------------------- +ammonium %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Ammonium") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +chloride %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Chloride") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +conductivity %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Conductivity") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +dissolved_oxygen %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Dissolved oxygen") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +nitrate %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Nitrate") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +nitrite %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Nitrite") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +phosphate %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("Phosphate") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +ph %>% + ggplot(aes(Collection_Date, Result)) + + geom_point(aes(colour = Units, shape = Method)) + + geom_line() + + theme_minimal() + + xlab("Date") + + ylab("Result") + + ggtitle("pH") + + scale_x_date(date_breaks = "2 years", date_labels = "%Y") + + theme(plot.title = element_text(hjust = 0.5)) + +# Most extreme years graphs ---------------------------------------------------- +# Air temperature +ggplot(air_temp_all_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", nrow=4, ncol=2) + + geom_point(aes(y = Average, color = "Average"), size = 3, shape = 18) + + geom_point(aes(y = Minimum, color = "Minimum"), size = 1, shape = 3) + + geom_point(aes(y = Maximum, color = "Maximum"), size = 1, shape = 0) + + labs(x = "Month", + y = "Monthly mean air temperature (C)", + color = "Legend") + + scale_color_manual(values = colors) + + ylim(-30,40) + + theme_minimal() + + theme(panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +# Water temperature - Aberfoyle station +ggplot(ABF_high_water_temp_all_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", nrow=3, ncol=2) + + geom_point(aes(y = Average, color = "Average"), size = 3, shape = 18) + + geom_point(aes(y = Minimum, color = "Minimum"), size = 1, shape = 3) + + geom_point(aes(y = Maximum, color = "Maximum"), size = 1, shape = 0) + + labs(x = "Month", + y = "Water temperature (C)", + color = "Legend") + + scale_color_manual(values = colors) + + ggtitle("Aberfoyle, high temperature years") + + theme_minimal() + + theme(plot.title = element_text(hjust = 0.5), panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +ggplot(ABF_low_water_temp_all_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", nrow=3, ncol=2) + + geom_point(aes(y = Average, color = "Average"), size = 3, shape = 18) + + geom_point(aes(y = Minimum, color = "Minimum"), size = 1, shape = 3) + + geom_point(aes(y = Maximum, color = "Maximum"), size = 1, shape = 0) + + labs(x = "Month", + y = "Water temperature (C)", + color = "Legend") + + scale_color_manual(values = colors) + + ggtitle("Aberfoyle, low temperature years") + + theme_minimal() + + theme(plot.title = element_text(hjust = 0.5), panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +# Water temperature - Side Road 10 station +ggplot(SR10_high_water_temp_all_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", nrow=3, ncol=2) + + geom_point(aes(y = Average, color = "Average"), size = 3, shape = 18) + + geom_point(aes(y = Minimum, color = "Minimum"), size = 1, shape = 3) + + geom_point(aes(y = Maximum, color = "Maximum"), size = 1, shape = 0) + + labs(x = "Month", + y = "Water temperature (C)", + color = "Legend") + + scale_color_manual(values = colors) + + ggtitle("Side Road 10, high temperature years") + + theme_minimal() + + theme(plot.title = element_text(hjust = 0.5), panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +ggplot(SR10_low_water_temp_all_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", nrow=3, ncol=2) + + geom_point(aes(y = Average, color = "Average"), size = 3, shape = 18) + + geom_point(aes(y = Minimum, color = "Minimum"), size = 1, shape = 3) + + geom_point(aes(y = Maximum, color = "Maximum"), size = 1, shape = 0) + + labs(x = "Month", + y = "Water temperature (C)", + color = "Legend") + + scale_color_manual(values = colors) + + ggtitle("Side Road 10, low temperature years") + + theme_minimal() + + theme(plot.title = element_text(hjust = 0.5), panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +# Precipitation - high years +ggplot(high_precip_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", ncol = 2) + + geom_point(aes(y = Total, color = "Total"), size = 3, shape = 18) + + labs(x = "Month", + y = "Total precipitation (mm)", + colour = "Legend") + + scale_color_manual(values = colours) + + ylim(0,250) + + ggtitle("High precipitation years") + + theme_minimal() + + theme(plot.title = element_text(hjust = 0.5), panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +# Precipitation - low years +ggplot(low_precip_years, aes(x = Month)) + + facet_wrap(~Year, scales = "free", ncol=2) + + geom_point(aes(y = Total, color = "Total"), size = 3, shape = 18) + + labs(x = "Month", + y = "Total precipitation (mm)", + colour = "Legend") + + scale_color_manual(values = colours) + + ylim(0,250) + + ggtitle("Low precipitation years") + + theme_minimal() + + theme(plot.title = element_text(hjust = 0.5), panel.grid.minor = element_line(color = "grey", + linewidth = 0.1, + linetype = 2)) + +# Rangers restoration graphs --------------------------------------------------- +palette <- hcl.colors(18, palette = "Set2") # define colour palette + +# Restoration methods +ggplot(years_reported_activities, aes(x = Restoration.Work.Performed, y = count, fill = Restoration.Work.Performed)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values=palette) + + labs(x = "Type of Restoration Work Reported", + y = "Number of Years Reported", + fill = "Restoration Work Reported") + + theme_minimal() + + scale_y_continuous(breaks = c(0,2,4,6,8,10,12,14,16,18,20)) + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +# Restoration sites +ggplot(years_reported_sites, aes(x = Location, y = count, fill = Location)) + + geom_bar(stat = "identity", color="black") + + scale_fill_manual(values = palette) + + labs(x = "Location of Restoration Work", + y = "Number of Years Reported", + fill = "Restoration Work Reported") + + theme_minimal() + + scale_y_continuous(breaks = c(0,2,4,6,8,10,12,14)) + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") diff --git a/code/air_temp.R b/code/air_temp.R new file mode 100644 index 0000000..ac802d4 --- /dev/null +++ b/code/air_temp.R @@ -0,0 +1,77 @@ +# AIR TEMPERATURE + +# Load packages ---------------------------------------------------------------- +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +## Import data ----------------------------------------------------------------- +# Read Excel file and combine data sheets +CSM_file_path <- "./data/air_temp/CSM_raw_air_temp.xlsx" # define file path +CSM_sheet_names <- excel_sheets(CSM_file_path) # define sheet names + +CSM_list <- lapply(CSM_sheet_names, function(CSM_sheet_names) { # read each sheet and store in a list + read_excel(CSM_file_path, sheet = CSM_sheet_names) +}) + +CSM_combined_data <- bind_rows(CSM_list) # combine all data frames + +View(CSM_combined_data) + +## Data prep ------------------------------------------------------------------- +# Adjust precision so all values have 2 decimal places +CSM_combined_data <- CSM_combined_data %>% + mutate(Value = round(Value, 2)) + +# Check for missing values +sum(is.na(CSM_combined_data)) + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) + +years_CSM <- unique(stringr::str_extract(CSM_sheet_names, "\\d{4}")) + +missing_CSM <- (setdiff(year_range, years_CSM)) + +print(missing_CSM) + +# Convert timestamp and extract year and month +CSM_combined_data <- CSM_combined_data %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Aggregate data by year and month, and get metrics +CSM_results <- CSM_combined_data %>% + group_by(Year, Month) %>% + summarise(Minimum = min(Value, na.rm = TRUE), + Maximum = max(Value, na.rm = TRUE), + Average = mean(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +# Export results as csv files into the R project +write.csv(CSM_results, "./data/air_temp/CSM_summarized_air_temp.csv") + +# Most extreme values ---------------------------------------------------------- +# Identify 5 highest average temp months +hot5_CSM <- CSM_results %>% + arrange(desc(Average)) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(hot5_CSM) + +# Identify 5 lowest average temp months +cold5_CSM <- CSM_results %>% + arrange(Average) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(cold5_CSM) + + diff --git a/code/biotic_graphing.R b/code/biotic_graphing.R new file mode 100644 index 0000000..cf5dbac --- /dev/null +++ b/code/biotic_graphing.R @@ -0,0 +1,245 @@ +### GRAPHING BIOTIC DATA + +## Load packages --------------------------------------------------------------- +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +if (!require(cowplot, quietly = TRUE)) { + install.packages("cowplot") + library(cowplot)} + +if (!require(gridExtra, quietly = TRUE)) { + install.packages("gridExtra") + library(gridExtra)} + +## Import data ----------------------------------------------------------------- +# Biotic inventory description data +inventory <- read_excel("./data/biotic_inventory_description.xlsx") +fish <- read_excel("./data/fish_order_family.xlsx") + +# STREAM data +stream <- read_excel("./data/STREAM_MILL CREEK GRCA_Taxonomic_Results_2023.xlsx", sheet = "Species") + +# Trout data +trout1 <- read_excel("data/species_scanned_docs.xlsx", sheet = "10.1_pages1-2") +trout2 <- read_excel("data/species_scanned_docs.xlsx", sheet = "10.1_pages4-9_and_3.11") + +# Human population data +census <- data.frame( #sourced from StatsCan census data + Year = c(1981, 1986, 1991, 1996, 2001, 2006, 2011, 2016, 2021), + Population = c(4480, 4885, 5397, 5416, 5885, 6689, 7029, 7336, 7944), + Dwellings = c(1385, 1520, 1745, 1895, 2028, 2396, 2619, 2793, 2946) +) + +## Data prep ------------------------------------------------------------------- +# Biotic inventory data prep +domains <- inventory %>% + mutate(`# Entries` = as.numeric(`# Entries`)) %>% + group_by(Domain) %>% + summarise(Total = sum(`# Entries`, na.rm = TRUE)) %>% + mutate(Domain = reorder(Domain, -Total)) + +eukaryote_kingdoms <- inventory %>% + mutate(`# Entries` = as.numeric(`# Entries`)) %>% + filter(Domain == "Eukaryota") %>% + group_by(Kingdom) %>% + summarise(Total = sum(`# Entries`, na.rm = TRUE)) %>% + mutate(Kingdom = reorder(Kingdom, -Total)) + +animal_phyla <- inventory %>% + mutate(`# Entries` = as.numeric(`# Entries`)) %>% + filter(Domain == "Eukaryota", Kingdom == "Animalia") %>% + group_by(Phylum) %>% + summarise(Total = sum(`# Entries`, na.rm = TRUE)) %>% + mutate(Phylum = reorder(Phylum, -Total)) + +vert_classes <- inventory %>% + mutate(`# Entries` = as.numeric(`# Entries`)) %>% + filter(Domain == "Eukaryota", Kingdom == "Animalia", Phylum == "Chordata") %>% + group_by(Class) %>% + summarise(Total = sum(`# Entries`, na.rm = TRUE)) %>% + mutate(Class = reorder(Class, -Total)) + +invert_classes <- inventory %>% + mutate(`# Entries` = as.numeric(`# Entries`)) %>% + filter(Domain == "Eukaryota", Kingdom == "Animalia", Phylum != "Chordata", !is.na(Class)) %>% + group_by(Class) %>% + summarise(Total = sum(`# Entries`, na.rm = TRUE)) %>% + mutate(Class = reorder(Class, -Total)) + + vert_classes <- vert_classes %>% mutate(Class = as.factor(Class), Type = "Vertebrate") + invert_classes <- invert_classes %>% mutate(Class = as.factor(Class), Type = "Invertebrate") + combined_classes <- rbind(vert_classes, invert_classes) + combined_classes$Class <- factor(combined_classes$Class, levels = c(levels(vert_classes$Class), "----", levels(invert_classes$Class))) + +fish_orders <- fish %>% + group_by(Order) %>% + summarise(Total = n()) %>% + mutate(Order = reorder(Order, -Total)) + +fish_families <- fish %>% + group_by(Family) %>% + summarise(Total = n()) %>% + mutate(Family = reorder(Family, -Total)) + +# STREAM data prep +filtered_stream_data <- stream %>% #select only sites on Mill Creek + filter(if_any(starts_with("MIL") | starts_with("MLC"), ~ !is.na(.))) %>% + select(-starts_with("BLR"), -starts_with("CHL"), -starts_with("HWC"), -starts_with("RAN")) %>% + mutate(across(starts_with("MIL") | starts_with("MLC"), ~ as.integer(. == "P"))) +View(filtered_stream_data) + +phylum_count <- filtered_stream_data %>% #count species in each phylum + group_by(Phylum) %>% + summarise(Species_Count = n_distinct(Species)) + +class_count <- filtered_stream_data %>% #count species in each class + group_by(Class) %>% + summarise(Species_Count = n_distinct(Species)) + +family_insecta_count <- filtered_stream_data %>% #subset by class Insecta and count species in each family + filter(Class == "Insecta") %>% + group_by(Family) %>% + summarise(Species_Count = n_distinct(Species)) + +# Trout population data prep +trout1 <- trout1 %>% + rename("trout_per_ha" = "#s/ha") + +trout2 <- trout2 %>% + filter(`population numbers per`!="station") + +brown_trout <- trout2 %>% filter(Species == "brown") #filter data for brown trout +brook_trout <- trout2 %>% filter(Species == "brook") #filter data for brook trout + +# Define color palette +palette <- hcl.colors(63, palette = "Set2") +palette2 <- hcl.colors(3, palette = "Set2") + +## Biotic inventory graphs ----------------------------------------------------- +# Graph Domains +ggplot(domains, aes(x = Domain, y = Total, fill = Domain)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Domains", y = "Entries (#)", fill = "Domain") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +# Graph Eukaryotic Kingdoms +ggplot(eukaryote_kingdoms, aes(x = Kingdom, y = Total, fill = Kingdom)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Eukaryote Kingdoms", y = "Entries (#)", fill = "Kingdom") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +# Graph Animal Phyla +ggplot(animal_phyla, aes(x = Phylum, y = Total, fill = Phylum)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Animal Phyla", y = "Entries (#)", fill = "Phylum") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +# Graph Classes +ggplot(combined_classes, aes(x = Class, y = Total, fill = Class)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Classes", y = "Entries (#)", fill = "Class") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), + legend.position = "none") + + scale_y_continuous(limits = c(0, 450)) + + geom_vline(xintercept = which(levels(combined_classes$Class) == "Insecta") - 1.5, linetype = "dashed") + + annotate("text", x = (which(levels(combined_classes$Class) == "Insecta") - 1.5) / 2, y = 450, label = "Vertebrate", vjust = 1.5, fontface = "italic") + + annotate("text", x = (which(levels(combined_classes$Class) == "Insecta") + length(levels(invert_classes$Class)) / 2 - 0.75), y = 450, label = "Invertebrate", vjust = 1.5, fontface = "italic") + +# Graph fish +ggplot(fish_orders, aes(x = Order, y = Total, fill = Order)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Fish Orders", y = "Entries (#)", fill = "Order") + + theme_minimal() + + scale_y_continuous(limits = c(0,9), breaks = 0:9) + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +ggplot(fish_families, aes(x = Family, y = Total, fill = Family)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Fish Families", y = "Entries (#)", fill = "Family") + + theme_minimal() + + scale_y_continuous(limits = c(0,8), breaks = 0:8) + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +## STREAM data graphs ---------------------------------------------------------- +# Graph Phyla +ggplot(phylum_count, aes(x = reorder(Phylum, -Species_Count), y = Species_Count, fill = Phylum)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Phylum", y = "Species (#)", fill = "Phylum") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +# Graph Classes +ggplot(class_count, aes(x = reorder(Class, -Species_Count), y = Species_Count, fill = Class)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Class", y = "Species (#)", fill = "Class") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +# Graph Families within Class Insecta +ggplot(family_insecta_count, aes(x = reorder(Family, -Species_Count), y = Species_Count, fill = Family)) + + geom_bar(stat = "identity", color = "black") + + scale_fill_manual(values = palette) + + labs(x = "Family", y = "Species (#)", fill = "Family") + + theme_minimal() + + theme(axis.text.x = element_text(angle = 90, hjust = 1), legend.position = "none") + +## Trout population graphs ----------------------------------------------------- +trout1 %>% + ggplot(aes(x = Year, y = trout_per_ha, color = Station, fill = Station)) + + geom_bar(stat = "identity", color = "white") + + scale_fill_manual(values=palette2) + + scale_x_continuous(breaks = unique(trout1$Year)) + #label every year + labs(x = "Year", y = "Trout/hectare (#)") + + theme_cowplot() + +brown_trout_yoy <- + ggplot(aes(x = Year, y = YOY, fill = Station), data = brown_trout) + + geom_bar(stat = "identity", color = "white") + + scale_fill_manual(values=palette2) + + scale_x_continuous(breaks = unique(brown_trout$Year)) + #label every year + labs(x = "Year", y = "Young of the year (#)") + + ggtitle("Brown trout") + + theme_cowplot() + + theme(plot.title = element_text(hjust = 0.5, face = "plain")) + +brook_trout_yoy <- + ggplot(aes(x = Year, y = YOY, fill = Station), data = brook_trout) + + geom_bar(stat = "identity", color = "white") + + scale_fill_manual(values=palette2) + + scale_x_continuous(breaks = unique(brook_trout$Year)) + #label every year + labs(x = "Year", y = "Young of the year (#)") + + ggtitle("Brook trout") + + theme_cowplot() + + theme(plot.title = element_text(hjust = 0.5, face = "plain")) + +grid.arrange(brown_trout_yoy, brook_trout_yoy, ncol=2) #combine brown and brook yoy plots + +## Human population graph ------------------------------------------------------ +ggplot(census, aes(x = Year)) + + geom_bar(aes(y = Population, fill = "Population"), stat = "identity", position = "identity") + + geom_bar(aes(y = Dwellings, fill = "Dwellings"), stat = "identity", position = "identity") + + scale_fill_manual(values = c("Population" = "grey80", "Dwellings" = "grey20"), name = "Legend") + + scale_x_continuous(breaks = census$Year, labels = census$Year) + + scale_y_continuous(name = "Population", + sec.axis = sec_axis(~ ., name = "Dwellings")) + #direct mapping for the second y-axis + theme_minimal() + + \ No newline at end of file diff --git a/code/mk_tests.R b/code/mk_tests.R new file mode 100644 index 0000000..9d0adac --- /dev/null +++ b/code/mk_tests.R @@ -0,0 +1,802 @@ +### MANN-KENDALL TESTS + +## Load packages --------------------------------------------------------------- +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +if (!require(lubridate, quietly = TRUE)) { + install.packages("lubridate") + library(lubridate)} + +if (!require(trend, quietly = TRUE)) { + install.packages("trend") + library(trend)} + +if (!require(gridExtra, quietly = TRUE)) { + install.packages("gridExtra") + library(gridExtra)} + +if (!require(patchwork, quietly = TRUE)) { + install.packages("patchwork") + library(patchwork)} + +## Air temperature ------------------------------------------------------------- +# Cambridge Shade's Mills +# Import data +CSM_file_path_air_temp <- "./data/air_temp/CSM_raw_air_temp.xlsx" # define file path +CSM_sheet_names_air_temp <- excel_sheets(CSM_file_path_air_temp) # define sheet names +CSM_list_air_temp <- lapply(CSM_sheet_names_air_temp, function(CSM_sheet_names_air_temp) { + read_excel(CSM_file_path_air_temp, sheet = CSM_sheet_names_air_temp) +}) # read each sheet and store in a list +CSM_combined_data_air_temp <- bind_rows(CSM_list_air_temp) # combine all data frames + +View(CSM_combined_data_air_temp) + +sum(is.na(CSM_combined_data_air_temp)) # check for missing values + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) +years_CSM_air_temp <- unique(stringr::str_extract(CSM_sheet_names_air_temp, "\\d{4}")) +missing_CSM_air_temp <- (setdiff(year_range, years_CSM_air_temp)) +print(missing_CSM_air_temp) # "1996" "1997" "1998" "1999" "2000" "2001" + +# Convert Timestamp and extract year and month +air_temp <- CSM_combined_data_air_temp %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Identify and remove incomplete years +year_month_count <- air_temp %>% # group by Year and count unique months + group_by(Year) %>% + summarise(Months = n_distinct(Month)) %>% + ungroup() + +incomplete_years <- year_month_count %>% # identify years with less than 8 months of data + filter(Months < 8) + +print(incomplete_years) # "2021" + +clean_air_temp <- air_temp %>% + filter(!Year %in% c(2021)) # remove incomplete years + +# MK on annual mean air temp +annual_mean_air_temp <- clean_air_temp %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +mk.test(annual_mean_air_temp$Mean) +sens.slope(annual_mean_air_temp$Mean) + +nrow(air_temp) # sample size = # observations + +# Graph annual mean air temp +annual_mean_air_temp <- rbind(annual_mean_air_temp, # add NA values for incomplete years + data.frame(Year = 2021, Mean = NA)) + +ggplot(annual_mean_air_temp, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 18) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "red3") + + labs(x = "Year", + y = "Annual Mean Air Temperature (C)") + +# MK on July mean air temp +july_mean_air_temp <- air_temp %>% + group_by(Year, Month) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') %>% + filter(Month == 7) + +mk.test(july_mean_air_temp$Mean) + +sens.slope(july_mean_air_temp$Mean) + +july_mean_air_temp_sample_size <- air_temp %>% + filter(Month == 7) # to calculate sample size + +nrow(july_mean_air_temp_sample_size) # sample size = # observations + +# MK on January mean air temp +jan_mean_air_temp <- air_temp %>% + group_by(Year, Month) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') %>% + filter(Month == 1) + +mk.test(jan_mean_air_temp$Mean) + +sens.slope(jan_mean_air_temp$Mean) + +jan_mean_air_temp_sample_size <- air_temp %>% + filter(Month == 1) # to calculate sample size + +nrow(jan_mean_air_temp_sample_size) # sample size = # observations + +# Graph January mean air temp +jan_mean_air_temp <- rbind(jan_mean_air_temp, # add NA values for missing years + data.frame(Year = 2022, Month = 1, Mean = NA)) + +july_airtemp <- ggplot(july_mean_air_temp, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 18) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "red3") + + ggtitle("July") + + theme(plot.title = element_text(hjust = 0.5, color = "red3"), + axis.title.y = element_blank(), + axis.text.y = element_blank(), + axis.ticks.y = element_blank()) + + labs(x = "Year", + y = "July Mean Air Temperature (C)") + + ylim(-10,25) + + xlim(2003,2023) + +jan_airtemp <- ggplot(jan_mean_air_temp, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 18) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "red3") + + ggtitle("January") + + theme(plot.title = element_text(hjust = 0.5, color = "red3")) + + labs(x = "Year", + y = "Monthly Mean Air Temperature (C)") + + ylim(-10,30) + + xlim(2003,2023) + +grid.arrange(jan_airtemp, july_airtemp, ncol = 2) # combine plots + + +## Precipitation --------------------------------------------------------------- +# Cambridge Shade's Mills +# Import data +CSM_file_path_precip <- "./data/precipitation/CSM_raw_precip.xlsx" # define file path +CSM_sheet_names_precip <- excel_sheets(CSM_file_path_precip) # define sheet names +CSM_list_precip <- lapply(CSM_sheet_names_precip, function(CSM_sheet_names_precip) { + read_excel(CSM_file_path_precip, sheet = CSM_sheet_names_precip) +}) # read each sheet and store in a list +CSM_combined_data_precip <- bind_rows(CSM_list_precip) # combine all data frames + +View(CSM_combined_data_precip) + +sum(is.na(CSM_combined_data_precip)) # check for missing values + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) +years_CSM_precip <- unique(stringr::str_extract(CSM_sheet_names_precip, "\\d{4}")) +missing_CSM_precip <- (setdiff(year_range, years_CSM_precip)) +print(missing_CSM_precip) # "1996" "1997" "1998" "1999" + +# Convert Timestamp and extract year and month +precip <- CSM_combined_data_precip %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Identify and remove incomplete years +year_month_count <- precip %>% # group by Year and count unique months + group_by(Year) %>% + summarise(Months = n_distinct(Month)) %>% + ungroup() + +incomplete_years <- year_month_count %>% # identify years with less than 8 months + filter(Months < 8) + +print(incomplete_years) # none + +# MK on annual mean air temp +annual_total_precip <- precip %>% + group_by(Year) %>% + summarise(Total = sum(Value, na.rm = TRUE), + .groups = 'drop') + +mk.test(annual_total_precip$Total) +sens.slope(annual_total_precip$Total) + +nrow(precip) # sample size = # observations + +# Graph total annual precipitation +ggplot(annual_total_precip, aes(x = Year, y = Total)) + + geom_point(size = 3, shape = 17) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "turquoise") + + labs(x = "Year", + y = "Total Annual Precipitation (mm)") + +## Water temperature ----------------------------------------------------------- +# Aberfoyle +# Import data +ABF_file_path_water_temp <- "./data/water_temp/ABF_raw_water_temp.xlsx" # define file path +ABF_sheet_names_water_temp <- excel_sheets(ABF_file_path_water_temp) # define sheet names +ABF_list_water_temp <- lapply(ABF_sheet_names_water_temp, function(ABF_sheet_names_water_temp) { + read_excel(ABF_file_path_water_temp, sheet = ABF_sheet_names_water_temp) +}) # read each sheet and store in a list +ABF_combined_data_water_temp <- bind_rows(ABF_list_water_temp) # combine all data frames + +View(ABF_combined_data_water_temp) + +sum(is.na(ABF_combined_data_water_temp)) # check for missing values + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) +years_ABF_water_temp <- unique(stringr::str_extract(ABF_sheet_names_water_temp, "\\d{4}")) +missing_ABF_water_temp <- (setdiff(year_range, years_ABF_water_temp)) +print(missing_ABF_water_temp) # "1996" "1997" "1998" "1999" "2000" "2001" "2020" "2021" + +# Convert Timestamp and extract year and month +ABF_water_temp <- ABF_combined_data_water_temp %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Identify and remove incomplete years +year_month_count <- ABF_water_temp %>% # group by Year and count unique months + group_by(Year) %>% + summarise(Months = n_distinct(Month)) %>% + ungroup() + +incomplete_years <- year_month_count %>% # identify years with less than 8 months of data + filter(Months < 8) + +print(incomplete_years) # "2002" "2015" "2016" "2022" + +clean_ABF_water_temp <- ABF_water_temp %>% + filter(!Year %in% c(2002,2015,2016,2022)) # remove incomplete years + +# MK on ABF annual mean water temp +ABF_annual_mean_water_temp <- clean_ABF_water_temp %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +mk.test(ABF_annual_mean_water_temp$Mean) +sens.slope(ABF_annual_mean_water_temp$Mean) + +nrow(ABF_water_temp) # sample size = # observations + +# Side Road 10 +# Import data +SR10_file_path_water_temp <- "./data/water_temp/SR10_raw_water_temp.xlsx" # define file path +SR10_sheet_names_water_temp <- excel_sheets(SR10_file_path_water_temp) # define sheet names +SR10_list_water_temp <- lapply(SR10_sheet_names_water_temp, function(SR10_sheet_names_water_temp) { + read_excel(SR10_file_path_water_temp, sheet = SR10_sheet_names_water_temp) +}) # read each sheet and store in a list +SR10_combined_data_water_temp <- bind_rows(SR10_list_water_temp) # combine all data frames + +View(SR10_combined_data_water_temp) + +sum(is.na(SR10_combined_data_water_temp)) # check for missing values + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) +years_SR10_water_temp <- unique(stringr::str_extract(SR10_sheet_names_water_temp, "\\d{4}")) +missing_SR10_water_temp <- (setdiff(year_range, years_SR10_water_temp)) +print(missing_SR10_water_temp) # "1996" "1997" "1998" "2015" "2020" "2021" + +# Convert Timestamp and extract year +SR10_water_temp <- SR10_combined_data_water_temp %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Identify and remove incomplete years +year_month_count <- SR10_water_temp %>% # group by Year and count unique months + group_by(Year) %>% + summarise(Months = n_distinct(Month)) %>% + ungroup() + +incomplete_years <- year_month_count %>% # identify years with less than 8 months of data + filter(Months < 8) + +print(incomplete_years) # "1999" 2014" "2016" "2019" 2022" + +clean_SR10_water_temp <- SR10_water_temp %>% + filter(!Year %in% c(1999,2014,2016,2019,2022)) # remove incomplete years + +# MK on SR10 annual mean water temp +SR10_annual_mean_water_temp <- clean_SR10_water_temp %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +mk.test(SR10_annual_mean_water_temp$Mean) +sens.slope(SR10_annual_mean_water_temp$Mean) + +nrow(SR10_water_temp) # sample size = # observations + +# Graph annual mean water temp for both gauges +ABF_annual_mean_water_temp <- rbind(ABF_annual_mean_water_temp, # add NA values for missing years + data.frame(Year = 2002, Mean = NA), + data.frame(Year = 2015, Mean = NA), + data.frame(Year = 2016, Mean = NA), + data.frame(Year = 2022, Mean = NA)) + +ABF_annual_mean_water_temp_graph <- ggplot(ABF_annual_mean_water_temp, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 16) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "royalblue") + + ggtitle("Aberfoyle") + + theme(plot.title = element_text(hjust = 0.5, color = "royalblue")) + + labs(x = "Year", + y = "Annual Mean Water Temperature (C)") + + ylim(6.5, 13.5) + + xlim(2000, 2023.5) + +SR10_annual_mean_water_temp <- rbind(SR10_annual_mean_water_temp, # add NA values for missing years + data.frame(Year = 1999, Mean = NA), + data.frame(Year = 2014, Mean = NA), + data.frame(Year = 2016, Mean = NA), + data.frame(Year = 2019, Mean = NA), + data.frame(Year = 2022, Mean = NA)) + +SR10_annual_mean_water_temp_graph <- ggplot(SR10_annual_mean_water_temp, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 16) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "royalblue") + + ggtitle("Side Road 10") + + theme(plot.title = element_text(hjust = 0.5, color = "royalblue"), + axis.title.y = element_blank(), + axis.text.y = element_blank(), + axis.ticks.y = element_blank()) + + labs(x = "Year") + + ylim(6.5, 13.5) + + xlim(2000, 2023.5) + +grid.arrange(ABF_annual_mean_water_temp_graph, SR10_annual_mean_water_temp_graph, ncol = 2) # combine plots + +# July max/min comparison with historical data +# Organize contemporary data and import historical data for Aberfoyle +ABF_jul_aug <- ABF_water_temp %>% + filter(Month %in% c(7, 8)) %>% # separate out July and August data + group_by(Year) %>% + summarise( # get max/min values + max = max(Value), + min = min(Value) + ) + +ABF_jul_aug_historical <- data.frame( # historical data + Year = c(1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994), + max = c(25.8, 24.7, 24.6, 24.7, 25.2, 25.5, 24.2, 23.9, 24.6, 22.3), + min = c(17.8, 15.9, 16.0, 12.4, 17.7, 17.7, 14.5, 16.1, 15.1, 17.5) +) + +ABF_jul_aug <- bind_rows(ABF_jul_aug, ABF_jul_aug_historical) + +ABF_jul_aug <- ABF_jul_aug %>% + arrange(Year) # sort by Year in ascending order + +View(ABF_jul_aug) + +mk.test(ABF_jul_aug$min) +sens.slope(ABF_jul_aug$min) + +mk.test(ABF_jul_aug$max) +sens.slope(ABF_jul_aug$max) + +nrow(ABF_jul_aug) # sample size = # observations + +# Organize contemporary data and import historical data for Side Road 10 +SR10_jul_aug <- SR10_water_temp %>% + filter(Month %in% c(7, 8)) %>% # separate out july and august data + group_by(Year) %>% + summarise( # get max/min values + max = max(Value), + min = min(Value) + ) + +SR10_jul_aug_historical <- data.frame( + Year = c(1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994), + max = c(23.9, 22.2, 21.3, 21.8, 22.3, 24.3, 21.6, 21.7, 21.3, 18.5), + min = c(15.3, 14.3, 13.8, 13.2, 15.0, 16.3, 13.3, 15.2, 15.4, 15.5) +) + +SR10_jul_aug <- bind_rows(SR10_jul_aug, SR10_jul_aug_historical) + +SR10_jul_aug <- SR10_jul_aug %>% + arrange(Year) # sort by Year in ascending order + +View(SR10_jul_aug) + +mk.test(SR10_jul_aug$min) +sens.slope(SR10_jul_aug$min) + +mk.test(SR10_jul_aug$max) +sens.slope(SR10_jul_aug$max) + +nrow(SR10_jul_aug) # sample size = # observations + +# Graph historical and contemporary data +ABF_jul_aug_graph <- ggplot(ABF_jul_aug, aes(x = Year)) + + geom_point(aes(y = min, color = "Minimum"), size = 3, shape = 16) + + geom_point(aes(y = max, color = "Maximum"), size = 3, shape = 1) + + geom_segment(aes(xend = Year, y = min, yend = max), linewidth = 0.4, color = "gray60") + + scale_color_manual(values = c("Minimum" = "royalblue", "Maximum" = "royalblue")) + + theme_minimal() + + ggtitle("Aberfoyle") + + theme(plot.title = element_text(hjust = 0.5, color = "royalblue")) + + labs(x = "Year", y = "July-August Water Temperature (C)", color = "") + + ylim(10, 28) + + xlim(1983, 2023.5) + +SR10_jul_aug_graph <- ggplot(SR10_jul_aug, aes(x = Year)) + + geom_point(aes(y = min, color = "Minimum"), size = 3, shape = 16) + + geom_point(aes(y = max, color = "Maximum"), size = 3, shape = 1) + + geom_segment(aes(xend = Year, y = min, yend = max), linewidth = 0.4, color = "gray60") + + scale_color_manual(values = c("Minimum" = "royalblue", "Maximum" = "royalblue")) + + theme_minimal() + + ggtitle("Side Road 10") + + theme(plot.title = element_text(hjust = 0.5, color = "royalblue"), + axis.title.y = element_blank(), + axis.text.y = element_blank(), + axis.ticks.y = element_blank()) + + labs(x = "Year", color = "") + + ylim(10, 28) + + xlim(1983, 2023.5) + +# Combine the plots with a shared legend +combined_plot <- (ABF_jul_aug_graph + SR10_jul_aug_graph) + + plot_layout(guides = 'collect') & + theme(legend.position = "right") +combined_plot + +## Water flow ------------------------------------------------------------------ +# Aberfoyle +# Import data +ABF_file_path_water_flow <- "./data/water_flow/ABF_raw_flow.xlsx" # define file path +ABF_sheet_names_water_flow <- excel_sheets(ABF_file_path_water_flow) # define sheet names +ABF_list_water_flow <- lapply(ABF_sheet_names_water_flow, function(ABF_sheet_names_water_flow) { + read_excel(ABF_file_path_water_flow, sheet = ABF_sheet_names_water_flow) +}) # read each sheet and store in a list +ABF_combined_data_water_flow <- bind_rows(ABF_list_water_flow) # combine all data frames + +View(ABF_combined_data_water_flow) + +sum(is.na(ABF_combined_data_water_flow)) # check for missing values + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) +years_ABF_water_flow <- unique(stringr::str_extract(ABF_sheet_names_water_flow, "\\d{4}")) +missing_ABF_water_flow <- (setdiff(year_range, years_ABF_water_flow)) +print(missing_ABF_water_flow) # "1996" "1997" "1998" "1999" "2000" "2001" "2020" "2021" + +# Convert Timestamp and extract year and month +ABF_water_flow <- ABF_combined_data_water_flow %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Identify and remove incomplete years +year_month_count <- ABF_water_flow %>% # group by Year and count unique months + group_by(Year) %>% + summarise(Months = n_distinct(Month)) %>% + ungroup() + +incomplete_years <- year_month_count %>% # identify years with less than 8 months of data + filter(Months < 8) + +print(incomplete_years) # "2002" "2020" + +clean_ABF_water_flow <- ABF_water_flow %>% + filter(!Year %in% c(2002,2020)) # remove incomplete years + +# MK on ABF annual mean water flow +ABF_annual_mean_water_flow <- clean_ABF_water_flow %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +mk.test(ABF_annual_mean_water_flow$Mean) +sens.slope(ABF_annual_mean_water_flow$Mean) + +nrow(ABF_water_flow) # sample size = # observations + +# Side Road 10 +# Import data +SR10_file_path_water_flow <- "./data/water_flow/SR10_raw_flow.xlsx" # define file path +SR10_sheet_names_water_flow <- excel_sheets(SR10_file_path_water_flow) # define sheet names +SR10_list_water_flow <- lapply(SR10_sheet_names_water_flow, function(SR10_sheet_names_water_flow) { + read_excel(SR10_file_path_water_flow, sheet = SR10_sheet_names_water_flow) +}) # read each sheet and store in a list +SR10_combined_data_water_flow <- bind_rows(SR10_list_water_flow) # combine all data frames + +View(SR10_combined_data_water_flow) + +sum(is.na(SR10_combined_data_water_flow)) # check for missing values + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) +years_SR10_water_flow <- unique(stringr::str_extract(SR10_sheet_names_water_flow, "\\d{4}")) +missing_SR10_water_flow <- (setdiff(year_range, years_SR10_water_flow)) +print(missing_SR10_water_flow) # "1996" "1997" "1998" "2015" "2020" "2021" + +# Convert Timestamp and extract year +SR10_water_flow <- SR10_combined_data_water_flow %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Identify and remove incomplete years +year_month_count <- SR10_water_flow %>% # group by Year and count unique months + group_by(Year) %>% + summarise(Months = n_distinct(Month)) %>% + ungroup() + +incomplete_years <- year_month_count %>% # identify years with less than 8 months of data + filter(Months < 8) + +print(incomplete_years) # "1999" + +clean_SR10_water_flow <- SR10_water_flow %>% + filter(!Year %in% c(1999)) # remove incomplete years + +# MK on SR10 annual mean water flow +SR10_annual_mean_water_flow <- clean_SR10_water_flow %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +mk.test(SR10_annual_mean_water_flow$Mean) +sens.slope(SR10_annual_mean_water_flow$Mean) + +nrow(SR10_water_flow) # sample size = # observations + +# Graph annual mean water flow for both gauges +ABF_annual_mean_water_flow <- rbind(ABF_annual_mean_water_flow, # add NA values for missing years + data.frame(Year = 2020, Mean = NA)) + +ABF_annual_mean_water_flow_graph <- ggplot(ABF_annual_mean_water_flow, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 1) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "darkgreen") + + ggtitle("Aberfoyle") + + theme(plot.title = element_text(hjust = 0.5, color = "darkgreen")) + + labs(x = "Year", + y = "Annual Mean Water Flow (m^3/s)") + + ylim(0.20,1.4) + + xlim(2000, 2023.5) + +SR10_annual_mean_water_flow_graph <- ggplot(SR10_annual_mean_water_flow, aes(x = Year, y = Mean)) + + geom_point(size = 3, shape = 1) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "darkgreen") + + ggtitle("Side Road 10") + + theme(plot.title = element_text(hjust = 0.5, color = "darkgreen"), + axis.title.y = element_blank(), + axis.text.y = element_blank(), + axis.ticks.y = element_blank()) + + labs(x = "Year") + + ylim(0.20,1.4) + + xlim(2000, 2023.5) + +grid.arrange(ABF_annual_mean_water_flow_graph, SR10_annual_mean_water_flow_graph, ncol = 2) # combine plots + +## Flashiness ------------------------------------------------------------------ +# Aberfoyle +# Import data +ABF_annual_flashiness <- read.csv("./data/water_flow/ABF_annual_flashiness.csv") + +# Remove years with incomplete flashiness data +clean_ABF_flashiness <- ABF_annual_flashiness %>% + filter(!Year %in% c(2002,2020)) # remove incomplete years + +# MK on ABF annual mean water flashiness +mk.test(clean_ABF_flashiness$FlashinessIndex) +sens.slope(clean_ABF_flashiness$FlashinessIndex) + +# Side Road 10 +# Import data +SR10_annual_flashiness <- read.csv("./data/water_flow/SR10_annual_flashiness.csv") + +# Remove years with incomplete flashiness data +clean_SR10_flashiness <- SR10_annual_flashiness %>% + filter(!Year %in% c(1999)) + +# MK on SR10 annual mean water flashiness +mk.test(clean_SR10_flashiness$FlashinessIndex) +sens.slope(clean_SR10_flashiness$FlashinessIndex) + +# Graph annual mean water flashiness for both gauges +ABF_flashiness <- rbind(clean_ABF_flashiness, # add NA values for missing years + data.frame(Year = 2020, X = NA, SumAbsChanges = NA, TotalFlow = NA, FlashinessIndex = NA)) + +ABF_flashiness_graph <- ggplot(ABF_flashiness, aes(x = Year, y = FlashinessIndex)) + + geom_point(size = 3, shape = 15) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "coral") + + ggtitle("Aberfoyle") + + theme(plot.title = element_text(hjust = 0.5, color = "coral")) + + labs(x = "Year", + y = "Annual Flashiness") + + ylim(0.125,0.275) + + xlim(2000, 2023.5) + +SR10_flashiness_graph <- ggplot(clean_SR10_flashiness, aes(x = Year, y = FlashinessIndex)) + + geom_point(size = 3, shape = 15) + + geom_line() + + theme_minimal() + + stat_smooth(method="lm", color = "coral") + + ggtitle("Side Road 10") + + theme(plot.title = element_text(hjust = 0.5, color = "coral"), + axis.title.y = element_blank(), + axis.text.y = element_blank(), + axis.ticks.y = element_blank()) + + labs(x = "Year") + + ylim(0.125,0.275) + + xlim(2000, 2023.5) + +grid.arrange(ABF_flashiness_graph, SR10_flashiness_graph, ncol = 2) # combine plots + + +## Surface water quality ------------------------------------------------------- +# Side Road 10 Provincial Water Quality Monitoring (PWQMN) data +wq_file_path <- "./data/water_quality/PWQMN_Mill_Creek_Data.xlsx" + +# Chloride +chloride_raw <- read_excel(wq_file_path, sheet = "Chloride") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +chloride_raw <- chloride_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +chloride <- subset(chloride_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(chloride$Mean) +sens.slope(chloride$Mean) + +nrow(chloride_raw) #sample size = # observations + +# Nitrite +nitrite_raw <- read_excel(wq_file_path, sheet = "Nitrite") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +nitrite_raw <- nitrite_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +nitrite <- subset(nitrite_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(nitrite$Mean) +sens.slope(nitrite$Mean) + +nrow(nitrite_raw) #sample size = # observations + +# Nitrate +nitrate_raw <- read_excel(wq_file_path, sheet = "Nitrate") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +nitrate_raw <- nitrate_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +nitrate <- subset(nitrate_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(nitrate$Mean) +sens.slope(nitrate$Mean) + +nrow(nitrate_raw) #sample size = # observations + +# Ammonium +ammonium_raw <- read_excel(wq_file_path, sheet = "Ammonium") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +ammonium_raw <- ammonium_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +ammonium <- subset(ammonium_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(ammonium$Mean) +sens.slope(ammonium$Mean) + +nrow(ammonium_raw) #sample size = # observations + +# Phosphate +phosphate_raw <- read_excel(wq_file_path, sheet = "Phosphate") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +phosphate_raw <- phosphate_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +phosphate <- subset(phosphate_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(phosphate$Mean) +sens.slope(phosphate$Mean) + +nrow(phosphate_raw) #sample size = # observations + +# Dissolved oxygen (DO) +do_raw <- read_excel(wq_file_path, sheet = "Dissolved Oxygen") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +do_raw <- do_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +do <- subset(do_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(do$Mean) +sens.slope(do$Mean) + +nrow(do_raw) #sample size = # observations + +# Conductivity +conductivity_raw <- read_excel(wq_file_path, sheet = "Conductivity") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +conductivity_raw <- conductivity_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +conductivity <- subset(conductivity_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +mk.test(conductivity$Mean) +sens.slope(conductivity$Mean) + +nrow(conductivity_raw) #sample size = # observations + +# pH +ph_raw <- read_excel(wq_file_path, sheet = "pH") %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + +ph_raw <- ph_raw %>% + mutate(Collection_Timestamp = ymd_hms(Collection_Timestamp), + Year = year(Collection_Timestamp)) + +sum(ph_raw$Result > 8.5) +mean(ph_raw$Result) + +ph <- subset(ph_raw, select = c(Year, Result)) %>% + group_by(Year) %>% + summarise(Mean = mean(Result, na.rm = TRUE), + .groups = 'drop') + +sum(ph$Mean > 8.5) + +mk.test(ph$Mean) +sens.slope(ph$Mean) + +nrow(ph_raw) #sample size = # observations diff --git a/code/precip.R b/code/precip.R new file mode 100644 index 0000000..a7933d1 --- /dev/null +++ b/code/precip.R @@ -0,0 +1,78 @@ +### PRECIPITATION + +## Load packages --------------------------------------------------------------- +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +## Import data ----------------------------------------------------------------- +# Read Excel file and combine sheets +CSM_file_path <- "./data/precipitation/CSM_raw_precip.xlsx" # define file path +CSM_sheet_names <- excel_sheets(CSM_file_path) # define sheet names + +CSM_list <- lapply(CSM_sheet_names, function(CSM_sheet_names) { # read each sheet and store in a list + read_excel(CSM_file_path, sheet = CSM_sheet_names) +}) + +CSM_combined_data <- bind_rows(CSM_list) # combine all data frames + +View(CSM_combined_data) + +## Data prep ------------------------------------------------------------------- +# Check for missing values +sum(is.na(CSM_combined_data)) + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) + +years_CSM <- unique(stringr::str_extract(CSM_sheet_names, "\\d{4}")) + +missing_CSM <- (setdiff(year_range, years_CSM)) + +print(missing_CSM) + +# Convert Timestamp and extract year and month for Cambridge Shade's Mill +CSM_combined_data <- CSM_combined_data %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Aggregate data by year and month, and get metrics +CSM_results <- CSM_combined_data %>% + group_by(Year, Month) %>% + summarise(Minimum = min(Value, na.rm = TRUE), + Maximum = max(Value, na.rm = TRUE), + Total = sum(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +# Export results as csv files into the R project +write.csv(CSM_results, "./data/precipitation/CSM_summarized_precip.csv") + +## Most extreme values --------------------------------------------------------- +# Identify 5 highest total precip years +yearly_total <- CSM_combined_data %>% #determine out yearly total + group_by(Year) %>% + summarise(Total = sum(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +high5_CSM <- yearly_total %>% + arrange(desc(Total)) %>% + slice_head(n = 5) %>% + select(Year, Total) + +print(high5_CSM) + +# Identify 5 lowest total precip years +low5_CSM <- yearly_total %>% + arrange((Total)) %>% + slice_head(n = 5) %>% + select(Year, Total) + +print(low5_CSM) + diff --git a/code/regressions.R b/code/regressions.R new file mode 100644 index 0000000..92f1384 --- /dev/null +++ b/code/regressions.R @@ -0,0 +1,1875 @@ +## REGRESSIONS + +## Load packages ------------------------------------------------------------ +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +if (!require(lubridate, quietly = TRUE)) { + install.packages("lubridate") + library(lubridate)} + +if (!require(fuzzyjoin, quietly = TRUE)) { + install.packages("fuzzyjoin") + library(fuzzyjoin)} + +if (!require(easystats, quietly = TRUE)) { + install.packages("easystats") + library(easystats)} + +if (!require(performance, quietly = TRUE)) { + install.packages("performance") + library(performance)} + +if (!require(nortest, quietly = TRUE)) { + install.packages("nortest") + library(nortest)} + +if (!require(forecast, quietly = TRUE)) { + install.packages("forecast") + library(forecast)} + +if (!require(MASS, quietly = TRUE)) { + install.packages("MASS") + library(MASS)} + +if (!require(car, quietly = TRUE)) { + install.packages("car") + library(car)} + +## Import data ----------------------------------------------------------------- +# Water quality +wq_file_path <- "./data/water_quality/PWQMN_Mill_Creek_Data.xlsx" +wq_sheets <- excel_sheets(wq_file_path) # list all sheet names + +# Precipitation +precip_file_path <- "./data/precipitation/CSM_raw_precip.xlsx" +precip_sheet_names <- excel_sheets(precip_file_path) # list all sheet names +precip_list <- lapply(precip_sheet_names, function(precip_sheet_names) { + read_excel(precip_file_path, sheet = precip_sheet_names) +}) # read sheet contents +precip_combined_data <- bind_rows(precip_list) # combine data + +# Water temp +wt_file_path <- "./data/water_temp/SR10_raw_water_temp.xlsx" +wt_sheet_names <- excel_sheets(wt_file_path) # list all sheet names +wt_list <- lapply(wt_sheet_names, function(wt_sheet_names) { + read_excel(wt_file_path, sheet = wt_sheet_names) +}) # read sheet contents +wt_combined_data <- bind_rows(wt_list) # combine data + +# Air temp +at_file_path <- "./data/air_temp/CSM_raw_air_temp.xlsx" +at_sheet_names <- excel_sheets(at_file_path) # list all sheet names +at_list <- lapply(at_sheet_names, function(sheet_name) { + read_excel(at_file_path, sheet = sheet_name) +}) # read sheet contents +at_combined_data <- bind_rows(at_list) # combine data + +## Define data prep functions -------------------------------------------------- +# Data prep functions take 20-30 mins to run, can skip to using prepared data + +wq_precip_data_prep <- function(wq_file_path, sheet_name, precip_combined_data) { + # load the water quality data + parameter_data <- read_excel(wq_file_path, sheet = sheet_name) %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + + # Define 36 hr period before sample was taken + parameter_data <- parameter_data %>% + mutate(Start_36hr_Period = Collection_Timestamp - hours(36)) + + # Define year range in the dataset + start_year <- year(min(parameter_data$Collection_Timestamp)) + end_year <- year(max(parameter_data$Collection_Timestamp)) + + # Extract unique months from water quality data + unique_months <- unique(month(parameter_data$Collection_Timestamp)) + + # Filter precip data based on year range and unique months + relevant_precip <- precip_combined_data %>% + filter(year(Timestamp) >= start_year & year(Timestamp) <= end_year & month(Timestamp) %in% unique_months) %>% + rename(Precip_Value = Value) + + # Join the datasets + joined_data <- parameter_data %>% + fuzzy_left_join(relevant_precip, by = c("Start_36hr_Period" = "Timestamp", "Collection_Timestamp" = "Timestamp"), match_fun = list(`<=`, `>=`)) + + # Calculate the total precipitation for each sample's 36-hour period + parameter_data <- joined_data %>% + group_by(Collection_Timestamp, Result, Units, Start_36hr_Period) %>% + summarise(Total_Precipitation = sum(Precip_Value, na.rm = TRUE), .groups = 'drop') + + return(parameter_data) +} + +wq_temp_data_prep <- function(wt_file_path, sheet_name, wt_combined_data) { + # load the water quality data + parameter_data <- read_excel(wq_file_path, sheet = sheet_name) %>% + select(`Collection Timestamp`, Result, Units) %>% + rename(Collection_Timestamp = `Collection Timestamp`) + + # Define 36 hr period before sample was taken + parameter_data <- parameter_data %>% + mutate(Start_36hr_Period = Collection_Timestamp - hours(36)) + + # Define year range in the dataset + start_year <- year(min(parameter_data$Collection_Timestamp)) + end_year <- year(max(parameter_data$Collection_Timestamp)) + + # Extract unique months from water quality data + unique_months <- unique(month(parameter_data$Collection_Timestamp)) + + # Filter water temp data based on year range and unique months + relevant_temp <- wt_combined_data %>% + filter(year(Timestamp) >= start_year & year(Timestamp) <= end_year & month(Timestamp) %in% unique_months) %>% + rename(WT_Value = Value) + + # Join the datasets + joined_data <- parameter_data %>% + fuzzy_left_join(relevant_temp, by = c("Start_36hr_Period" = "Timestamp", "Collection_Timestamp" = "Timestamp"), match_fun = list(`<=`, `>=`)) + + # Calculate the mean temperature for each sample's 36-hour period + parameter_data <- joined_data %>% + group_by(Collection_Timestamp, Result, Units, Start_36hr_Period) %>% + summarise(Mean_Water_Temp = mean(WT_Value, na.rm = TRUE), .groups = 'drop') + + return(parameter_data) +} + +## Ammonium data prep ---------------------------------------------------------- +# Integrate precip data +ammonium_precip <- wq_precip_data_prep(wq_file_path, "Ammonium", precip_combined_data) + +# Select specific columns of precip data +ammonium_precip <- ammonium_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +ammonium_temp <- wq_temp_data_prep(wq_file_path, "Ammonium", wt_combined_data) + +# Remove blank value rows +ammonium_temp <- filter(ammonium_temp, Mean_Water_Temp!="NaN") + +# Join temp and precip +ammonium <- left_join(ammonium_temp, ammonium_precip, by = "Collection_Timestamp") + +# Ln transformation of ammonium +ammonium$log_transformed <- log(ammonium$Result) +ammonium$log_transformed[ammonium$log_transformed=="-Inf"]<-0 + +# Log transformation of ammonium +ammonium$log_transformed <- log10(ammonium$Result) +ammonium$log_transformed[ammonium$log_transformed=="-Inf"]<-0 + +# Square root transformation of ammonium +ammonium$sqrt_transformed <- sqrt(ammonium$Result) + +# Save prepared data +write.csv(ammonium, "./data/water_quality/ammonium.csv") + +## Chloride data prep ---------------------------------------------------------- +# Integrate precip data +chloride_precip <- wq_precip_data_prep(wq_file_path, "Chloride", precip_combined_data) + +# Select specific columns of precip data +chloride_precip <- chloride_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +chloride_temp <- wq_temp_data_prep(wq_file_path, "Chloride", wt_combined_data) + +# Remove blank value rows +chloride_temp <- filter(chloride_temp, Mean_Water_Temp!="NaN") + +# Join temp and precip +chloride <- left_join(chloride_temp, chloride_precip, by = "Collection_Timestamp") + +# Ln transformation of chloride +chloride$ln_transformed <- log(chloride$Result) +chloride$ln_transformed[chloride$ln_transformed=="-Inf"]<-0 + +# Log transformation of chloride +chloride$log_transformed <- log10(chloride$Result) +chloride$log_transformed[chloride$log_transformed=="-Inf"]<-0 + +# Square root transformation of chloride +chloride$sqrt_transformed <- sqrt(chloride$Result) + +# Save prepared data +write.csv(chloride, "./data/water_quality/chloride.csv") + + +## Conductivity data prep ------------------------------------------------------ +# Integrate precip data +conductivity_precip <- wq_precip_data_prep(wq_file_path, "Conductivity", precip_combined_data) + +# Select specific columns of precip data +conductivity_precip <- conductivity_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +conductivity_temp <- wq_temp_data_prep(wq_file_path, "Conductivity", wt_combined_data) + +# Remove blank value rows +conductivity_temp <- filter(conductivity_temp, Mean_Water_Temp!="NaN") + +# Delete duplicated value +conductivity_temp <- conductivity_temp[-53,] + +# Join temp and precip +conductivity <- left_join(conductivity_temp, conductivity_precip, by = "Collection_Timestamp") + +# Ln transformation of conductivity +conductivity$ln_transformed <- log(conductivity$Result) +conductivity$ln_transformed[conductivity$log_transformed=="-Inf"]<-0 + +# Log transformation of conductivity +conductivity$log_transformed <- log10(conductivity$Result) +conductivity$log_transformed[conductivity$log_transformed=="-Inf"]<-0 + +# Square root transformation of conductivity +conductivity$sqrt_transformed <- sqrt(conductivity$Result) + +# Save prepared data +write.csv(conductivity, "./data/water_quality/conductivity.csv") + + +## Dissolved oxygen data prep -------------------------------------------------- +# Integrate precip data +do_precip <- wq_precip_data_prep(wq_file_path, "Dissolved Oxygen", precip_combined_data) + +# Select specific columns of precip data +do_precip <- do_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +do_temp <- wq_temp_data_prep(wq_file_path, "Dissolved Oxygen", wt_combined_data) + +# Remove blank value rows +do_temp <- filter(do_temp, Mean_Water_Temp!="NaN") + +# Join temp and precip +do <- left_join(do_temp, do_precip, by = "Collection_Timestamp") + +# Ln transformation of do +do$ln_transformed <- log(do$Result) +do$ln_transformed[do$ln_transformed=="-Inf"]<-0 + +# Log transformation of do +do$log_transformed <- log10(do$Result) +do$log_transformed[do$log_transformed=="-Inf"]<-0 + +# Square root transformation of do +do$sqrt_transformed <- sqrt(do$Result) + +# Save prepared data +write.csv(do, "./data/water_quality/do.csv") + +## Nitrate data prep ----------------------------------------------------------- +# Integrate precip data +nitrate_precip <- wq_precip_data_prep(wq_file_path, "Nitrate", precip_combined_data) + +# Select specific columns of precip data +nitrate_precip <- nitrate_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +nitrate_temp <- wq_temp_data_prep(wq_file_path, "Nitrate", wt_combined_data) + +# Remove blank value rows +nitrate_temp <- filter(nitrate_temp, Mean_Water_Temp!="NaN") + +# Join temp and precip +nitrate <- left_join(nitrate_temp, nitrate_precip, by = "Collection_Timestamp") + +# Ln transformation of nitrate +nitrate$ln_transformed <- log(nitrate$Result) +nitrate$ln_transformed[nitrate$ln_transformed=="-Inf"]<-0 + +# Log transformation of nitrate +nitrate$log_transformed <- log10(nitrate$Result) +nitrate$log_transformed[nitrate$log_transformed=="-Inf"]<-0 + +# Square root transformation of nitrate +nitrate$sqrt_transformed <- sqrt(nitrate$Result) + +# Save prepared data +write.csv(nitrate, "./data/water_quality/nitrate.csv") + +## Nitrite data prep ----------------------------------------------------------- +# Integrate precip data +nitrite_precip <- wq_precip_data_prep(wq_file_path, "Nitrite", precip_combined_data) + +# Select specific columns of precip data +nitrite_precip <- nitrite_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +nitrite_temp <- wq_temp_data_prep(wq_file_path, "Nitrite", wt_combined_data) + +# Remove blank value rows +nitrite_temp <- filter(nitrite_temp, Mean_Water_Temp!="NaN") + +# Join temp and precip +nitrite <- left_join(nitrite_temp, nitrite_precip, by = "Collection_Timestamp") + +# Ln transformation of nitrite +nitrite$ln_transformed <- log(nitrite$Result) +nitrite$ln_transformed[nitrite$ln_transformed=="-Inf"]<-0 + +# Log transformation of nitrite +nitrite$log_transformed <- log10(nitrite$Result) +nitrite$log_transformed[nitrite$log_transformed=="-Inf"]<-0 + +# Square root transformation of nitrite +nitrite$sqrt_transformed <- sqrt(nitrite$Result) + +# Save prepared data +write.csv(nitrite, "./data/water_quality/nitrite.csv") + +## pH data prep ---------------------------------------------------------------- +# Integrate precip data +ph_precip <- wq_precip_data_prep(wq_file_path, "pH", precip_combined_data) + +# Select specific columns of precip data +ph_precip <- ph_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +ph_temp <- wq_temp_data_prep(wq_file_path, "pH", wt_combined_data) + +# Remove blank value rows +ph_temp <- filter(ph_temp, Mean_Water_Temp!="NaN") + +# Delete duplicated value +ph_temp <- ph_temp[-53,] + +# Join temp and precip +ph <- left_join(ph_temp, ph_precip, by = "Collection_Timestamp") + +# Ln transformation of pH +ph$ln_transformed <- log(ph$Result) +ph$ln_transformed[ph$ln_transformed=="-Inf"]<-0 + +# Log transformation of pH +ph$log_transformed <- log10(ph$Result) +ph$log_transformed[ph$log_transformed=="-Inf"]<-0 + +#Square root transformation of pH +ph$sqrt_transformed <- sqrt(ph$Result) + +# Save prepared data +write.csv(ph, "./data/water_quality/ph.csv") + +## Phosphate data prep --------------------------------------------------------- +# Integrate precip data +phosphate_precip <- wq_precip_data_prep(wq_file_path, "Phosphate", precip_combined_data) + +# Select specific columns of precip data +phosphate_precip <- phosphate_precip %>% + select(Collection_Timestamp, Total_Precipitation) + +# Integrate water temp data +phosphate_temp <- wq_temp_data_prep(wq_file_path, "Phosphate", wt_combined_data) + +# Remove blank value rows +phosphate_temp <- filter(phosphate_temp, Mean_Water_Temp!="NaN") + +# Delete negative value +phosphate_temp <- phosphate_temp[-10,] + +# Join temp and precip +phosphate <- left_join(phosphate_temp, phosphate_precip, by = "Collection_Timestamp") + +# Ln transformation of phosphate +phosphate$ln_transformed <- log(phosphate$Result) +phosphate$ln_transformed[phosphate$ln_transformed=="-Inf"]<-0 + +# Log transformation of phosphate +phosphate$log_transformed <- log10(phosphate$Result) +phosphate$log_transformed[phosphate$log_transformed=="-Inf"]<-0 + +# Square root transformation of phosphate +phosphate$sqrt_transformed <- sqrt(phosphate$Result) + +# Save prepared data +write.csv(phosphate, "./data/water_quality/phosphate.csv") + +## Temperature data prep ------------------------------------------------------- +wt_combined_data$date <- as.Date(ymd_hms(wt_combined_data$Timestamp, truncated = 6)) # add date column + +water_daily_avg <- wt_combined_data %>% + group_by(date) %>% + summarise(daily_avg_water_temp = mean(Value, na.rm = TRUE)) # get daily avg water temp + +at_combined_data$date <- as.Date(ymd_hms(at_combined_data$Timestamp, truncated = 6)) # add date column + +air_daily_avg <- at_combined_data %>% + group_by(date) %>% + summarise(daily_avg_air_temp = mean(Value, na.rm = TRUE)) # get daily avg air temp + +# Combine water and air temp +combined_daily_avg <- left_join(water_daily_avg, air_daily_avg, by = "date") + +# Delete rows with NA values +combined_daily_avg <- drop_na(combined_daily_avg) + +# Ln transformations +combined_daily_avg$ln_transformed_air <- log(combined_daily_avg$daily_avg_air_temp) +combined_daily_avg$ln_transformed_air[combined_daily_avg$ln_transformed_air=="-Inf"]<-0 + +combined_daily_avg$ln_transformed_water <- log(combined_daily_avg$daily_avg_water_temp) +combined_daily_avg$ln_transformed_water[combined_daily_avg$ln_transformed_water=="-Inf"]<-0 + +# Log transformations +combined_daily_avg$log_transformed_air <- log10(combined_daily_avg$daily_avg_air_temp) +combined_daily_avg$log_transformed_air[combined_daily_avg$log_transformed_air=="-Inf"]<-0 + +combined_daily_avg$log_transformed_water <- log10(combined_daily_avg$daily_avg_water_temp) +combined_daily_avg$log_transformed_water[combined_daily_avg$log_transformed_water=="-Inf"]<-0 + +# Square root transformations +combined_daily_avg$sqrt_transformed_air <- sqrt(combined_daily_avg$daily_avg_air_temp) +combined_daily_avg$sqrt_transformed_air[combined_daily_avg$sqrt_transformed_air=="-Inf"]<-0 + +combined_daily_avg$sqrt_transformed_water <- sqrt(combined_daily_avg$daily_avg_water_temp) +combined_daily_avg$sqrt_transformed_water[combined_daily_avg$sqrt_transformed_water=="-Inf"]<-0 + +# Clean data +combined_daily_avg <- na.omit(combined_daily_avg) + +View(combined_daily_avg) + +## Ammonium regression --------------------------------------------------------- +ammonium <- read.csv("./data/water_quality/ammonium.csv") + +# Visualize data +ammonium %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Ammonium concentration (mg/L)") + + theme_minimal() + +ammonium %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Ammonium concentration (mg/L)") + + theme_minimal() + +# Summary statistics +summary(ammonium$Result) +summary(ammonium$Total_Precipitation) +summary(ammonium$Mean_Water_Temp) + +# Histograms +ammonium %>% # raw - right skewed + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 0.005) + + labs(x = "Ammonium concentration (mg/L)", y = "Frequency") + +ammonium %>% # ln transformed - slight right skew, almost normal + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Ln transformed ammonium concentration (ln[mg/L])", y = "Frequency") + +ammonium %>% # log transformed - right skew + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Log transformed ammonium concentration (log[mg/L])", y = "Frequency") + +ammonium %>% # sqrt transformed - normal + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Sqrt transformed ammonium concentration (sqrt[mg/L])", y = "Frequency") + +# Check normality +shapiro_ammonium <- shapiro.test(ammonium$Result) %>% print() # non-normal, p = 5.035e-09 +shapiro_ammonium_ln <- shapiro.test(ammonium$ln_transformed) %>% print() # non-normal, p = 6.557e-06 +shapiro_ammonium_log <- shapiro.test(ammonium$log_transformed) %>% print() # non-normal, p = 6.557e-06 +shapiro_ammonium_sqrt <- shapiro.test(ammonium$sqrt_transformed) %>% print() # borderline normal, p = 0.02306 + +# Regressions - raw ammonium +ammonium_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = ammonium) # linear model with both predictors and "*" interaction +summary(ammonium_model_synergy) +check_normality(ammonium_model_synergy) # non-normality of residuals detected (p < .001) + +ammonium_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = ammonium) # linear model with both predictors and "+" interaction +summary(ammonium_model_additive) +check_normality(ammonium_model_additive) # non-normality of residuals detected (p < .001) + +ammonium_model_precip <- lm(Result ~ Total_Precipitation, data = ammonium) # linear model with only precip +summary(ammonium_model_precip) +check_normality(ammonium_model_precip) # non-normality of residuals detected (p < .001) + +ammonium_model_temp <- lm(Result ~ Mean_Water_Temp, data = ammonium) # linear model with only water temp +summary(ammonium_model_temp) +check_normality(ammonium_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ammonium_model_synergy, ammonium_model_additive, ammonium_model_precip, ammonium_model_temp) # temp model has lowest AIC + +# Regressions - ln transformed ammonium +ln_ammonium_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ammonium) # linear model with both predictors and "*" interaction +summary(ln_ammonium_model_synergy) +check_normality(ln_ammonium_model_synergy) # non-normality of residuals detected (p < .001) + +ln_ammonium_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ammonium) # linear model with both predictors and "+" interaction +summary(ln_ammonium_model_additive) +check_normality(ln_ammonium_model_additive) # non-normality of residuals detected (p = 0.005) + +ln_ammonium_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = ammonium) # linear model with only precip +summary(ln_ammonium_model_precip) +check_normality(ln_ammonium_model_precip) # non-normality of residuals detected (p = 0.004) + +ln_ammonium_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = ammonium) # linear model with only water temp +summary(ln_ammonium_model_temp) +check_normality(ln_ammonium_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ln_ammonium_model_synergy, ln_ammonium_model_additive, ln_ammonium_model_precip, ln_ammonium_model_temp) # synergistic model has lowest AIC + +# Regressions - log transformed ammonium +log_ammonium_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ammonium) # linear model with both predictors and "*" interaction +summary(log_ammonium_model_synergy) +check_normality(log_ammonium_model_synergy) # non-normality of residuals detected (p < .001) + +log_ammonium_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ammonium) # linear model with both predictors and "+" interaction +summary(log_ammonium_model_additive) +check_normality(log_ammonium_model_additive) # non-normality of residuals detected (p = 0.005) + +log_ammonium_model_precip <- lm(log_transformed ~ Total_Precipitation, data = ammonium) # linear model with only precip +summary(log_ammonium_model_precip) +check_normality(log_ammonium_model_precip) # non-normality of residuals detected (p = 0.004) + +log_ammonium_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = ammonium) # linear model with only water temp +summary(log_ammonium_model_temp) +check_normality(log_ammonium_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(log_ammonium_model_synergy, log_ammonium_model_additive, log_ammonium_model_precip, log_ammonium_model_temp) # synergistic model has lowest AIC + +# Regressions - sqrt transformed ammonium +sqrt_ammonium_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ammonium) # linear model with both predictors and "*" interaction +summary(sqrt_ammonium_model_synergy) +check_normality(sqrt_ammonium_model_synergy) # residuals appear as normally distributed (p = 0.167) + +sqrt_ammonium_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ammonium) # linear model with both predictors and "+" interaction +summary(sqrt_ammonium_model_additive) +check_normality(sqrt_ammonium_model_additive) # residuals appear as normally distributed (p = 0.342) + +sqrt_ammonium_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = ammonium) # linear model with only precip +summary(sqrt_ammonium_model_precip) +check_normality(sqrt_ammonium_model_precip) # non-normality of residuals detected (p = 0.017) + +sqrt_ammonium_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = ammonium) # linear model with only water temp +summary(sqrt_ammonium_model_temp) +check_normality(sqrt_ammonium_model_temp) # residuals appear as normally distributed (p = 0.420) + +compare_performance(sqrt_ammonium_model_synergy, sqrt_ammonium_model_additive, sqrt_ammonium_model_precip, sqrt_ammonium_model_temp) # temp model has lowest AIC, where temp is a borderline significant predictor + +par(mfrow = c(2, 2)) +plot(sqrt_ammonium_model_temp) + +# Plot ammonium +ggplot(ammonium, aes(x = Mean_Water_Temp, y = sqrt_transformed)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Mean Water Temperature (C)", y = "Square root transformed ammonium concentration (sqrt[mg/L])") + + theme_minimal() + +## Chloride regression --------------------------------------------------------- +chloride <- read.csv("./data/water_quality/chloride.csv") + +# Visualize data +chloride %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Chloride concentration (mg/L)") + + theme_minimal() + +chloride %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Chloride concentration (mg/L)") + + theme_minimal() + +# Summary statistics +summary(chloride$Result) +summary(chloride$Total_Precipitation) +summary(chloride$Mean_Water_Temp) + +# Histograms +chloride %>% # raw - multimodal + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 1) + + labs(x = "Chloride concentration (mg/L)", y = "Frequency") + +chloride %>% # ln transformed - normal + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Ln transformed chloride concentration (ln[mg/L])", y = "Frequency") + +chloride %>% # log transformed - normal + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Log transformed chloride concentration (log[mg/L])", y = "Frequency") + +chloride %>% # sqrt transformed - normal + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.1) + + labs(x = "Sqrt transformed chloride concentration (sqrt[mg/L])", y = "Frequency") + +# Check normality +shapiro_chloride <- shapiro.test(chloride$Result) %>% print() # borderline normal, p = 0.01516 +shapiro_chloride_ln <- shapiro.test(chloride$ln_transformed) %>% print() # normal, p = 0.07253 +shapiro_chloride_log <- shapiro.test(chloride$log_transformed) %>% print() # normal, p = 0.07253 +shapiro_chloride_sqrt <- shapiro.test(chloride$sqrt_transformed) %>% print() # borderline normal, p = 0.04934 + +# Regressions - raw chloride +chloride_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = chloride) # linear model with both predictors and "*" interaction +summary(chloride_model_synergy) +check_normality(chloride_model_synergy) # non-normality of residuals detected (p = 0.002) + +chloride_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = chloride) # linear model with both predictors and "+" interaction +summary(chloride_model_additive) +check_normality(chloride_model_additive) # non-normality of residuals detected (p = 0.003) + +chloride_model_precip <- lm(Result ~ Total_Precipitation, data = chloride) # linear model with only precip +summary(chloride_model_precip) +check_normality(chloride_model_precip) # non-normality of residuals detected (p = 0.005) + +chloride_model_temp <- lm(Result ~ Mean_Water_Temp, data = chloride) # linear model with only water temp +summary(chloride_model_temp) +check_normality(chloride_model_temp) # non-normality of residuals detected (p = 0.007) + +compare_performance(chloride_model_synergy, chloride_model_additive, chloride_model_precip, chloride_model_temp) # temp model has lowest AIC + +# Regressions - ln transformed chloride +ln_chloride_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = chloride) # linear model with both predictors and "*" interaction +summary(ln_chloride_model_synergy) +check_normality(ln_chloride_model_synergy) # residuals appear as normally distributed (p = 0.155) + +ln_chloride_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = chloride) # linear model with both predictors and "+" interaction +summary(ln_chloride_model_additive) +check_normality(ln_chloride_model_additive) # residuals appear as normally distributed (p = 0.201) + +ln_chloride_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = chloride) # linear model with only precip +summary(ln_chloride_model_precip) +check_normality(ln_chloride_model_precip) # residuals appear as normally distributed (p = 0.085) + +ln_chloride_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = chloride) # linear model with only water temp +summary(ln_chloride_model_temp) +check_normality(ln_chloride_model_temp) # residuals appear as normally distributed (p = 0.236) + +compare_performance(ln_chloride_model_synergy, ln_chloride_model_additive, ln_chloride_model_precip, ln_chloride_model_temp) # precip model has lowest AIC + +# Regressions - log transformed chloride +log_chloride_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = chloride) # linear model with both predictors and "*" interaction +summary(log_chloride_model_synergy) +check_normality(log_chloride_model_synergy) # residuals appear as normally distributed (p = 0.155) + +log_chloride_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = chloride) # linear model with both predictors and "+" interaction +summary(log_chloride_model_additive) +check_normality(log_chloride_model_additive) # residuals appear as normally distributed (p = 0.201) + +log_chloride_model_precip <- lm(log_transformed ~ Total_Precipitation, data = chloride) # linear model with only precip +summary(log_chloride_model_precip) +check_normality(log_chloride_model_precip) # residuals appear as normally distributed (p = 0.085) + +log_chloride_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = chloride) # linear model with only water temp +summary(log_chloride_model_temp) +check_normality(log_chloride_model_temp) # residuals appear as normally distributed (p = 0.236) + +compare_performance(log_chloride_model_synergy, log_chloride_model_additive, log_chloride_model_precip, log_chloride_model_temp) # precip model has lowest AIC + +# Regressions - sqrt transformed chloride +sqrt_chloride_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = chloride) # linear model with both predictors and "*" interaction +summary(sqrt_chloride_model_synergy) +check_normality(sqrt_chloride_model_synergy) # non-normality of residuals detected (p = 0.022) + +sqrt_chloride_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = chloride) # linear model with both predictors and "+" interaction +summary(sqrt_chloride_model_additive) +check_normality(sqrt_chloride_model_additive) # non-normality of residuals detected (p = 0.034) + +sqrt_chloride_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = chloride) # linear model with only precip +summary(sqrt_chloride_model_precip) +check_normality(sqrt_chloride_model_precip) # non-normality of residuals detected (p = 0.031) + +sqrt_chloride_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = chloride) # linear model with only water temp +summary(sqrt_chloride_model_temp) +check_normality(sqrt_chloride_model_temp) # residuals appear as normally distributed (p = 0.057) + +compare_performance(sqrt_chloride_model_synergy, sqrt_chloride_model_additive, sqrt_chloride_model_precip, sqrt_chloride_model_temp) # temp model has lowest AIC + +# Compare all models with normal residuals +compare_performance(ln_chloride_model_synergy, ln_chloride_model_additive, ln_chloride_model_precip, ln_chloride_model_temp, log_chloride_model_synergy, log_chloride_model_additive, log_chloride_model_precip, log_chloride_model_temp, sqrt_chloride_model_temp) # log_chloride_model_temp has the best fit + +# Plot chloride +ggplot(chloride, aes(x = Mean_Water_Temp, y = log_transformed)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Mean Water Temperature (C)", y = "Log transformed chloride concentration (log[mg/L])") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(log_chloride_model_temp) + +## Nitrate regression ---------------------------------------------------------- +nitrate <- read.csv("./data/water_quality/nitrate.csv") + +# Visualize data +nitrate %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Nitrate concentration (mg/L)") + + theme_minimal() + +nitrate %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Nitrate concentration (mg/L)") + + theme_minimal() + +# Summary statistics +summary(nitrate$Result) +summary(nitrate$Total_Precipitation) +summary(nitrate$Mean_Water_Temp) + +# Histograms +nitrate %>% # raw - right skew + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Nitrate concentration (mg/L)", y = "Frequency") + +nitrate %>% # ln transformed - right skew + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Ln transformed nitrate concentration (ln[mg/L])", y = "Frequency") + +nitrate %>% # log transformed - right skew + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Log transformed nitrate concentration (log[mg/L])", y = "Frequency") + +nitrate %>% # sqrt transformed - right skew + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Sqrt transformed nitrate concentration (sqrt[mg/L])", y = "Frequency") + +# Check normality +shapiro_nitrate <- shapiro.test(nitrate$Result) %>% print() # non-normal, p = 1e-15 +shapiro_nitrate_ln <- shapiro.test(nitrate$ln_transformed) %>% print() # non-normal, p = 4.227e-05 +shapiro_nitrate_log <- shapiro.test(nitrate$log_transformed) %>% print() # non-normal, p = 4.227e-05 +shapiro_nitrate_sqrt <- shapiro.test(nitrate$sqrt_transformed) %>% print() # non-normal, p = 1.334e-10 + +# Regressions - raw nitrate +nitrate_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = nitrate) # linear model with both predictors and "*" interaction +summary(nitrate_model_synergy) +check_normality(nitrate_model_synergy) # non-normality of residuals detected (p < .001) + +nitrate_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = nitrate) # linear model with both predictors and "+" interaction +summary(nitrate_model_additive) +check_normality(nitrate_model_additive) # non-normality of residuals detected (p < .001) + +nitrate_model_precip <- lm(Result ~ Total_Precipitation, data = nitrate) # linear model with only precip +summary(nitrate_model_precip) +check_normality(nitrate_model_precip) # non-normality of residuals detected (p < .001) + +nitrate_model_temp <- lm(Result ~ Mean_Water_Temp, data = nitrate) # linear model with only water temp +summary(nitrate_model_temp) +check_normality(nitrate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(nitrate_model_synergy, nitrate_model_additive, nitrate_model_precip, nitrate_model_temp) # temp model has lowest AIC + +# Regressions - ln transformed nitrate +ln_nitrate_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrate) # linear model with both predictors and "*" interaction +summary(ln_nitrate_model_synergy) +check_normality(ln_nitrate_model_synergy) # non-normality of residuals detected (p < .001) + +ln_nitrate_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrate) # linear model with both predictors and "+" interaction +summary(ln_nitrate_model_additive) +check_normality(ln_nitrate_model_additive) # non-normality of residuals detected (p < .001) + +ln_nitrate_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = nitrate) # linear model with only precip +summary(ln_nitrate_model_precip) +check_normality(ln_nitrate_model_precip) # non-normality of residuals detected (p < .001) + +ln_nitrate_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = nitrate) # linear model with only water temp +summary(ln_nitrate_model_temp) +check_normality(ln_nitrate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ln_nitrate_model_synergy, ln_nitrate_model_additive, ln_nitrate_model_precip, ln_nitrate_model_temp) # additive model has lowest AIC + +# Regressions - log transformed nitrate +log_nitrate_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrate) # linear model with both predictors and "*" interaction +summary(log_nitrate_model_synergy) +check_normality(log_nitrate_model_synergy) # non-normality of residuals detected (p < .001) + +log_nitrate_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrate) # linear model with both predictors and "+" interaction +summary(log_nitrate_model_additive) +check_normality(log_nitrate_model_additive) # non-normality of residuals detected (p < .001) + +log_nitrate_model_precip <- lm(log_transformed ~ Total_Precipitation, data = nitrate) # linear model with only precip +summary(log_nitrate_model_precip) +check_normality(log_nitrate_model_precip) # non-normality of residuals detected (p < .001) + +log_nitrate_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = nitrate) # linear model with only water temp +summary(log_nitrate_model_temp) +check_normality(log_nitrate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(log_nitrate_model_synergy, log_nitrate_model_additive, log_nitrate_model_precip, log_nitrate_model_temp) # additive model has lowest AIC + +# Regressions - sqrt transformed nitrate +sqrt_nitrate_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrate) # linear model with both predictors and "*" interaction +summary(sqrt_nitrate_model_synergy) +check_normality(sqrt_nitrate_model_synergy) # non-normality of residuals detected (p < .001) + +sqrt_nitrate_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrate) # linear model with both predictors and "+" interaction +summary(sqrt_nitrate_model_additive) +check_normality(sqrt_nitrate_model_additive) # non-normality of residuals detected (p < .001) + +sqrt_nitrate_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = nitrate) # linear model with only precip +summary(sqrt_nitrate_model_precip) +check_normality(sqrt_nitrate_model_precip) # non-normality of residuals detected (p < .001) + +sqrt_nitrate_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = nitrate) # linear model with only water temp +summary(sqrt_nitrate_model_temp) +check_normality(sqrt_nitrate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(sqrt_nitrate_model_synergy, sqrt_nitrate_model_additive, sqrt_nitrate_model_precip, sqrt_nitrate_model_temp) # additive model has lowest AIC + +# Box cox transformation +lambda_nitrate <- BoxCox.lambda(nitrate$Result) # find the optimal lambda +transformed_conductivity <- BoxCox(nitrate$Result, lambda_nitrate) # transform raw values using lambda +nitrate$box_cox_transformed = transformed_nitrate # make new column in dataset +View(nitrate) + +shapiro.test(nitrate$box_cox_transformed) # non-normal, p = 0.0001404 + +# Regressions - box cox transformed nitrate +box_cox_nitrate_model_synergy <- lm(box_cox_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrate) # linear model with both predictors and "*" interaction +summary(box_cox_nitrate_model_synergy) +check_normality(box_cox_nitrate_model_synergy) # non-normality of residuals detected (p < .001) + +box_cox_nitrate_model_additive <- lm(box_cox_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrate) # linear model with both predictors and "+" interaction +summary(box_cox_nitrate_model_additive) +check_normality(box_cox_nitrate_model_additive) # non-normality of residuals detected (p < .001) + +box_cox_nitrate_model_precip <- lm(box_cox_transformed ~ Total_Precipitation, data = nitrate) # linear model with only precip +summary(box_cox_nitrate_model_precip) +check_normality(box_cox_nitrate_model_precip) # non-normality of residuals detected (p < .001) + +box_cox_nitrate_model_temp <- lm(box_cox_transformed ~ Mean_Water_Temp, data = nitrate) # linear model with only water temp +summary(box_cox_nitrate_model_temp) +check_normality(box_cox_nitrate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(box_cox_nitrate_model_synergy, box_cox_nitrate_model_additive, box_cox_nitrate_model_precip, box_cox_nitrate_model_temp) # synergistic model has lowest AIC + +# Robust regression +nitrate_rlm_synergy <- rlm(Result ~ Total_Precipitation * Mean_Water_Temp, data = nitrate) # rlm model with both predictors and "*" interaction +summary(nitrate_rlm_synergy) + +nitrate_rlm_additive <- rlm(Result ~ Total_Precipitation + Mean_Water_Temp, data = nitrate) # rlm model with both predictors and "+" interaction +summary(nitrate_rlm_additive) + +nitrate_rlm_precip <- rlm(Result ~ Total_Precipitation, data = nitrate) # rlm model with only precip +summary(nitrate_rlm_precip) + +nitrate_rlm_temp <- rlm(Result ~ Mean_Water_Temp, data = nitrate) # rlm model with only temp +summary(nitrate_rlm_temp) + +compare_performance(nitrate_rlm_synergy, nitrate_rlm_additive, nitrate_rlm_precip, nitrate_rlm_temp) # temp model has lowest AIC + +# Plot nitrate +ggplot(nitrate, aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Mean Water Temperature (C)", y = "Nitrate concentration (mg/L)") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(nitrate_rlm_temp) + +## Nitrite regression ---------------------------------------------------------- +nitrite <- read.csv("./data/water_quality/nitrite.csv") + +# Visualize data +nitrite %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Nitrite concentration (mg/L)") + + theme_minimal() + +nitrite %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Nitrite concentration (mg/L)") + + theme_minimal() + +# Summary statistics +summary(nitrite$Result) +summary(nitrite$Total_Precipitation) +summary(nitrite$Mean_Water_Temp) + +# Histograms +nitrite %>% # raw - right skew + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 0.001) + + labs(x = "Nitrite concentration (mg/L)", y = "Frequency") + +nitrite %>% # ln transformed - right skew + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Ln transformed nitrite concentration (ln[mg/L])", y = "Frequency") + +nitrite %>% # log transformed - right skew + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Log transformed nitrite concentration (log[mg/L])", y = "Frequency") + +nitrite %>% # sqrt transformed - normal + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.01) + + labs(x = "Sqrt transformed nitrite concentration (sqrt[mg/L])", y = "Frequency") + +# Check normality +shapiro_nitrite <- shapiro.test(nitrite$Result) %>% print() # non-normal, p = 1.98e-06 +shapiro_nitrite_ln <- shapiro.test(nitrite$ln_transformed) %>% print() # non-normal, p = 4.638e-13 +shapiro_nitrite_log <- shapiro.test(nitrite$log_transformed) %>% print() # non-normal, p = 4.638e-13 +shapiro_nitrite_sqrt <- shapiro.test(nitrite$sqrt_transformed) %>% print() # non-normal, p = 3.252e-06 + +# Regressions - raw nitrite +nitrite_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = nitrite) # linear model with both predictors and "*" interaction +summary(nitrite_model_synergy) +check_normality(nitrite_model_synergy) # non-normality of residuals detected (p < .001) + +nitrite_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = nitrite) # linear model with both predictors and "+" interaction +summary(nitrite_model_additive) +check_normality(nitrite_model_additive) # non-normality of residuals detected (p < .001) + +nitrite_model_precip <- lm(Result ~ Total_Precipitation, data = nitrite) # linear model with only precip +summary(nitrite_model_precip) +check_normality(nitrite_model_precip) # non-normality of residuals detected (p < .001) + +nitrite_model_temp <- lm(Result ~ Mean_Water_Temp, data = nitrite) # linear model with only water temp +summary(nitrite_model_temp) +check_normality(nitrite_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(nitrite_model_synergy, nitrite_model_additive, nitrite_model_precip, nitrite_model_temp) # precip model has lowest AIC + +# Regressions - ln transformed nitrite +ln_nitrite_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrite) # linear model with both predictors and "*" interaction +summary(ln_nitrite_model_synergy) +check_normality(ln_nitrite_model_synergy) # non-normality of residuals detected (p < .001) + +ln_nitrite_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrite) # linear model with both predictors and "+" interaction +summary(ln_nitrite_model_additive) +check_normality(ln_nitrite_model_additive) # non-normality of residuals detected (p < .001) + +ln_nitrite_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = nitrite) # linear model with only precip +summary(ln_nitrite_model_precip) +check_normality(ln_nitrite_model_precip) # non-normality of residuals detected (p < .001) + +ln_nitrite_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = nitrite) # linear model with only water temp +summary(ln_nitrite_model_temp) +check_normality(ln_nitrite_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ln_nitrite_model_synergy, ln_nitrite_model_additive, ln_nitrite_model_precip, ln_nitrite_model_temp) # precip model has lowest AIC + +# Regressions - log transformed nitrite +log_nitrite_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrite) # linear model with both predictors and "*" interaction +summary(log_nitrite_model_synergy) +check_normality(log_nitrite_model_synergy) # non-normality of residuals detected (p < .001) + +log_nitrite_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrite) # linear model with both predictors and "+" interaction +summary(log_nitrite_model_additive) +check_normality(log_nitrite_model_additive) # non-normality of residuals detected (p < .001) + +log_nitrite_model_precip <- lm(log_transformed ~ Total_Precipitation, data = nitrite) # linear model with only precip +summary(log_nitrite_model_precip) +check_normality(log_nitrite_model_precip) # non-normality of residuals detected (p < .001) + +log_nitrite_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = nitrite) # linear model with only water temp +summary(log_nitrite_model_temp) +check_normality(log_nitrite_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(log_nitrite_model_synergy, log_nitrite_model_additive, log_nitrite_model_precip, log_nitrite_model_temp) # precip model has lowest AIC + +# Regressions - sqrt transformed nitrite +sqrt_nitrite_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrite) # linear model with both predictors and "*" interaction +summary(sqrt_nitrite_model_synergy) +check_normality(sqrt_nitrite_model_synergy) # non-normality of residuals detected (p < .001) + +sqrt_nitrite_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrite) # linear model with both predictors and "+" interaction +summary(sqrt_nitrite_model_additive) +check_normality(sqrt_nitrite_model_additive) # non-normality of residuals detected (p < .001) + +sqrt_nitrite_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = nitrite) # linear model with only precip +summary(sqrt_nitrite_model_precip) +check_normality(sqrt_nitrite_model_precip) # non-normality of residuals detected (p < .001) + +sqrt_nitrite_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = nitrite) # linear model with only water temp +summary(sqrt_nitrite_model_temp) +check_normality(sqrt_nitrite_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(sqrt_nitrite_model_synergy, sqrt_nitrite_model_additive, sqrt_nitrite_model_precip, sqrt_nitrite_model_temp) # precip and temp models have lowest AIC + +# Box cox transformation +lambda_nitrite <- BoxCox.lambda(nitrite$Result) # find the optimal lambda +transformed_conductivity <- BoxCox(nitrite$Result, lambda_nitrite) # transform raw values using lambda +nitrite$box_cox_transformed = transformed_nitrite # make new column in dataset +View(nitrite) + +shapiro.test(nitrite$box_cox_transformed) # non-normal, p = 4.262e-06 + +# Regressions - box cox transformed nitrite +box_cox_nitrite_model_synergy <- lm(box_cox_transformed ~ Total_Precipitation * Mean_Water_Temp, data = nitrite) # linear model with both predictors and "*" interaction +summary(box_cox_nitrite_model_synergy) +check_normality(box_cox_nitrite_model_synergy) # non-normality of residuals detected (p < .001) + +box_cox_nitrite_model_additive <- lm(box_cox_transformed ~ Total_Precipitation + Mean_Water_Temp, data = nitrite) # linear model with both predictors and "+" interaction +summary(box_cox_nitrite_model_additive) +check_normality(box_cox_nitrite_model_additive) # non-normality of residuals detected (p < .001) + +box_cox_nitrite_model_precip <- lm(box_cox_transformed ~ Total_Precipitation, data = nitrite) # linear model with only precip +summary(box_cox_nitrite_model_precip) +check_normality(box_cox_nitrite_model_precip) # non-normality of residuals detected (p < .001) + +box_cox_nitrite_model_temp <- lm(box_cox_transformed ~ Mean_Water_Temp, data = nitrite) # linear model with only water temp +summary(box_cox_nitrite_model_temp) +check_normality(box_cox_nitrite_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(box_cox_nitrite_model_synergy, box_cox_nitrite_model_additive, box_cox_nitrite_model_precip, box_cox_nitrite_model_temp) # precip and temp models have lowest AIC + +# Robust regression +nitrite_rlm_synergy <- rlm(Result ~ Total_Precipitation * Mean_Water_Temp, data = nitrite) # rlm model with both predictors and "*" interaction +summary(nitrite_rlm_synergy) + +nitrite_rlm_additive <- rlm(Result ~ Total_Precipitation + Mean_Water_Temp, data = nitrite) # rlm model with both predictors and "+" interaction +summary(nitrite_rlm_additive) + +nitrite_rlm_precip <- rlm(Result ~ Total_Precipitation, data = nitrite) # rlm model with only precip +summary(nitrite_rlm_precip) + +nitrite_rlm_temp <- rlm(Result ~ Mean_Water_Temp, data = nitrite) # rlm model with only temp +summary(nitrite_rlm_temp) + +compare_performance(nitrite_rlm_synergy, nitrite_rlm_additive, nitrite_rlm_precip, nitrite_rlm_temp) # precip model has lowest AIC + +# Plot nitrite +ggplot(nitrite, aes(x = Total_Precipitation, y = Result)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Total precipitation (mm)", y = "Nitrite concentration (mg/L)") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(nitrite_rlm_precip) + +## Phosphate regression ---------------------------------------------------------- +phosphate <- read.csv("./data/water_quality/phosphate.csv") + +# Visualize data +phosphate %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Phosphate concentration (mg/L)") + + theme_minimal() + +phosphate %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Phosphate concentration (mg/L)") + + theme_minimal() + +# Summary statistics +summary(phosphate$Result) +summary(phosphate$Total_Precipitation) +summary(phosphate$Mean_Water_Temp) + +# Histograms +phosphate %>% # raw - right skew + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 0.005) + + labs(x = "Phosphate concentration (mg/L)", y = "Frequency") + +phosphate %>% # ln transformed - right skew + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Ln transformed phosphate concentration (ln[mg/L])", y = "Frequency") + +phosphate %>% # log transformed - right skew + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Log transformed phosphate concentration (log[mg/L])", y = "Frequency") + +phosphate %>% # sqrt transformed - right skew + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.01) + + labs(x = "Sqrt transformed phosphate concentration (sqrt[mg/L])", y = "Frequency") + +# Check normality +shapiro_phosphate <- shapiro.test(phosphate$Result) %>% print() # non-normal, p = 7.303e-12 +shapiro_phosphate_ln <- shapiro.test(phosphate$ln_transformed) %>% print() # non-normal, p = 2.116e-10 +shapiro_phosphate_log <- shapiro.test(phosphate$log_transformed) %>% print() # non-normal, p = 2.116e-10 +shapiro_phosphate_sqrt <- shapiro.test(phosphate$sqrt_transformed) %>% print() # non-normal, p = 0.0005937 + +# Regressions - raw phosphate +phosphate_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = phosphate) # linear model with both predictors and "*" interaction +summary(phosphate_model_synergy) +check_normality(phosphate_model_synergy) # non-normality of residuals detected (p < .001) + +phosphate_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = phosphate) # linear model with both predictors and "+" interaction +summary(phosphate_model_additive) +check_normality(phosphate_model_additive) # non-normality of residuals detected (p < .001) + +phosphate_model_precip <- lm(Result ~ Total_Precipitation, data = phosphate) # linear model with only precip +summary(phosphate_model_precip) +check_normality(phosphate_model_precip) # non-normality of residuals detected (p < .001) + +phosphate_model_temp <- lm(Result ~ Mean_Water_Temp, data = phosphate) # linear model with only water temp +summary(phosphate_model_temp) +check_normality(phosphate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(phosphate_model_synergy, phosphate_model_additive, phosphate_model_precip, phosphate_model_temp) # precip model has lowest AIC + +# Regressions - ln transformed phosphate +ln_phosphate_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = phosphate) # linear model with both predictors and "*" interaction +summary(ln_phosphate_model_synergy) +check_normality(ln_phosphate_model_synergy) # non-normality of residuals detected (p < .001) + +ln_phosphate_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = phosphate) # linear model with both predictors and "+" interaction +summary(ln_phosphate_model_additive) +check_normality(ln_phosphate_model_additive) # non-normality of residuals detected (p < .001) + +ln_phosphate_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = phosphate) # linear model with only precip +summary(ln_phosphate_model_precip) +check_normality(ln_phosphate_model_precip) # non-normality of residuals detected (p < .001) + +ln_phosphate_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = phosphate) # linear model with only water temp +summary(ln_phosphate_model_temp) +check_normality(ln_phosphate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ln_phosphate_model_synergy, ln_phosphate_model_additive, ln_phosphate_model_precip, ln_phosphate_model_temp) # precip model has lowest AIC + +# Regressions - log transformed phosphate +log_phosphate_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = phosphate) # linear model with both predictors and "*" interaction +summary(log_phosphate_model_synergy) +check_normality(log_phosphate_model_synergy) # non-normality of residuals detected (p < .001) + +log_phosphate_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = phosphate) # linear model with both predictors and "+" interaction +summary(log_phosphate_model_additive) +check_normality(log_phosphate_model_additive) # non-normality of residuals detected (p < .001) + +log_phosphate_model_precip <- lm(log_transformed ~ Total_Precipitation, data = phosphate) # linear model with only precip +summary(log_phosphate_model_precip) +check_normality(log_phosphate_model_precip) # non-normality of residuals detected (p < .001) + +log_phosphate_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = phosphate) # linear model with only water temp +summary(log_phosphate_model_temp) +check_normality(log_phosphate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(log_phosphate_model_synergy, log_phosphate_model_additive, log_phosphate_model_precip, log_phosphate_model_temp) # precip model has lowest AIC + +# Regressions - sqrt transformed phosphate +sqrt_phosphate_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = phosphate) # linear model with both predictors and "*" interaction +summary(sqrt_phosphate_model_synergy) +check_normality(sqrt_phosphate_model_synergy) # non-normality of residuals detected (p = 0.002) + +sqrt_phosphate_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = phosphate) # linear model with both predictors and "+" interaction +summary(sqrt_phosphate_model_additive) +check_normality(sqrt_phosphate_model_additive) # non-normality of residuals detected (p = 0.003) + +sqrt_phosphate_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = phosphate) # linear model with only precip +summary(sqrt_phosphate_model_precip) +check_normality(sqrt_phosphate_model_precip) # non-normality of residuals detected (p = 0.005) + +sqrt_phosphate_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = phosphate) # linear model with only water temp +summary(sqrt_phosphate_model_temp) +check_normality(sqrt_phosphate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(sqrt_phosphate_model_synergy, sqrt_phosphate_model_additive, sqrt_phosphate_model_precip, sqrt_phosphate_model_temp) # precip model has lowest AIC + +# Box cox transformation +lambda_phosphate <- BoxCox.lambda(phosphate$Result) # find the optimal lambda +transformed_conductivity <- BoxCox(phosphate$Result, lambda_phosphate) # transform raw values using lambda +phosphate$box_cox_transformed = transformed_phosphate # make new column in dataset +View(phosphate) + +shapiro.test(phosphate$box_cox_transformed) # non-normal, p < 2.2e-16 + +# Regressions - box cox transformed phosphate +box_cox_phosphate_model_synergy <- lm(box_cox_transformed ~ Total_Precipitation * Mean_Water_Temp, data = phosphate) # linear model with both predictors and "*" interaction +summary(box_cox_phosphate_model_synergy) +check_normality(box_cox_phosphate_model_synergy) # non-normality of residuals detected (p < .001) + +box_cox_phosphate_model_additive <- lm(box_cox_transformed ~ Total_Precipitation + Mean_Water_Temp, data = phosphate) # linear model with both predictors and "+" interaction +summary(box_cox_phosphate_model_additive) +check_normality(box_cox_phosphate_model_additive) # non-normality of residuals detected (p < .001) + +box_cox_phosphate_model_precip <- lm(box_cox_transformed ~ Total_Precipitation, data = phosphate) # linear model with only precip +summary(box_cox_phosphate_model_precip) +check_normality(box_cox_phosphate_model_precip) # non-normality of residuals detected (p < .001) + +box_cox_phosphate_model_temp <- lm(box_cox_transformed ~ Mean_Water_Temp, data = phosphate) # linear model with only water temp +summary(box_cox_phosphate_model_temp) +check_normality(box_cox_phosphate_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(box_cox_phosphate_model_synergy, box_cox_phosphate_model_additive, box_cox_phosphate_model_precip, box_cox_phosphate_model_temp) # precip models has lowest AIC + +# Robust regression +phosphate_rlm_synergy <- rlm(Result ~ Total_Precipitation * Mean_Water_Temp, data = phosphate) # rlm model with both predictors and "*" interaction +phosphate_rlm_synergy <- rlm(Result ~ Total_Precipitation * Mean_Water_Temp, data = phosphate, maxit = 50) # need more steps +summary(phosphate_rlm_synergy) + +phosphate_rlm_additive <- rlm(Result ~ Total_Precipitation + Mean_Water_Temp, data = phosphate) # rlm model with both predictors and "+" interaction +summary(phosphate_rlm_additive) + +phosphate_rlm_precip <- rlm(Result ~ Total_Precipitation, data = phosphate) # rlm model with only precip +summary(phosphate_rlm_precip) + +phosphate_rlm_temp <- rlm(Result ~ Mean_Water_Temp, data = phosphate) # rlm model with only temp +summary(phosphate_rlm_temp) + +compare_performance(phosphate_rlm_synergy, phosphate_rlm_additive, phosphate_rlm_precip, phosphate_rlm_temp) # precip model has lowest AIC + +# Plot phosphate +ggplot(phosphate, aes(x = Total_Precipitation, y = Result)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Total precipitation (mm)", y = "Phosphate concentration (mg/L)") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(phosphate_rlm_precip) + +## Conductivity regression ---------------------------------------------------------- +conductivity <- read.csv("./data/water_quality/conductivity.csv") + +# Visualize data +conductivity %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Conductivity (uS/cm)") + + theme_minimal() + +conductivity %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Conductivity (uS/cm)") + + theme_minimal() + +# Summary statistics +summary(conductivity$Result) +summary(conductivity$Total_Precipitation) +summary(conductivity$Mean_Water_Temp) + +# Histograms +conductivity %>% # raw - slight left skew + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 30) + + labs(x = "Conductivity (uS/cm)", y = "Frequency") + +conductivity %>% # ln transformed - left skew + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Ln transformed conductivity (uS/cm)", y = "Frequency") + +conductivity %>% # log transformed - left skew + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Log transformed conductivity (uS/cm)", y = "Frequency") + +conductivity %>% # sqrt transformed - left skew + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 1) + + labs(x = "Sqrt transformed conductivity (uS/cm)", y = "Frequency") + +# Check normality +shapiro_conductivity <- shapiro.test(conductivity$Result) %>% print() # non-normal, p = 1.937e-06 +shapiro_conductivity_ln <- shapiro.test(conductivity$ln_transformed) %>% print() # non-normal, p = 4.744e-09 +shapiro_conductivity_log <- shapiro.test(conductivity$log_transformed) %>% print() # non-normal, p = 4.744e-09 +shapiro_conductivity_sqrt <- shapiro.test(conductivity$sqrt_transformed) %>% print() # non-normal, p = 1.044e-07 + +# Regressions - raw conductivity +conductivity_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = conductivity) # linear model with both predictors and "*" interaction +summary(conductivity_model_synergy) +check_normality(conductivity_model_synergy) # non-normality of residuals detected (p < .001) + +conductivity_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = conductivity) # linear model with both predictors and "+" interaction +summary(conductivity_model_additive) +check_normality(conductivity_model_additive) # non-normality of residuals detected (p < .001) + +conductivity_model_precip <- lm(Result ~ Total_Precipitation, data = conductivity) # linear model with only precip +summary(conductivity_model_precip) +check_normality(conductivity_model_precip) # non-normality of residuals detected (p < .001) + +conductivity_model_temp <- lm(Result ~ Mean_Water_Temp, data = conductivity) # linear model with only water temp +summary(conductivity_model_temp) +check_normality(conductivity_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(conductivity_model_synergy, conductivity_model_additive, conductivity_model_precip, conductivity_model_temp) # additive model has lowest AIC + +# Regressions - ln transformed conductivity +ln_conductivity_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = conductivity) # linear model with both predictors and "*" interaction +summary(ln_conductivity_model_synergy) +check_normality(ln_conductivity_model_synergy) # non-normality of residuals detected (p < .001) + +ln_conductivity_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = conductivity) # linear model with both predictors and "+" interaction +summary(ln_conductivity_model_additive) +check_normality(ln_conductivity_model_additive) # non-normality of residuals detected (p < .001) + +ln_conductivity_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = conductivity) # linear model with only precip +summary(ln_conductivity_model_precip) +check_normality(ln_conductivity_model_precip) # non-normality of residuals detected (p < .001) + +ln_conductivity_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = conductivity) # linear model with only water temp +summary(ln_conductivity_model_temp) +check_normality(ln_conductivity_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ln_conductivity_model_synergy, ln_conductivity_model_additive, ln_conductivity_model_precip, ln_conductivity_model_temp) # precip model has lowest AIC + +# Regressions - log transformed conductivity +log_conductivity_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = conductivity) # linear model with both predictors and "*" interaction +summary(log_conductivity_model_synergy) +check_normality(log_conductivity_model_synergy) # non-normality of residuals detected (p < .001) + +log_conductivity_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = conductivity) # linear model with both predictors and "+" interaction +summary(log_conductivity_model_additive) +check_normality(log_conductivity_model_additive) # non-normality of residuals detected (p < .001) + +log_conductivity_model_precip <- lm(log_transformed ~ Total_Precipitation, data = conductivity) # linear model with only precip +summary(log_conductivity_model_precip) +check_normality(log_conductivity_model_precip) # non-normality of residuals detected (p < .001) + +log_conductivity_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = conductivity) # linear model with only water temp +summary(log_conductivity_model_temp) +check_normality(log_conductivity_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(log_conductivity_model_synergy, log_conductivity_model_additive, log_conductivity_model_precip, log_conductivity_model_temp) # additive model has lowest AIC + +# Regressions - sqrt transformed conductivity +sqrt_conductivity_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = conductivity) # linear model with both predictors and "*" interaction +summary(sqrt_conductivity_model_synergy) +check_normality(sqrt_conductivity_model_synergy) # non-normality of residuals detected (p < .001) + +sqrt_conductivity_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = conductivity) # linear model with both predictors and "+" interaction +summary(sqrt_conductivity_model_additive) +check_normality(sqrt_conductivity_model_additive) # non-normality of residuals detected (p < .001) + +sqrt_conductivity_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = conductivity) # linear model with only precip +summary(sqrt_conductivity_model_precip) +check_normality(sqrt_conductivity_model_precip) # non-normality of residuals detected (p < .001) + +sqrt_conductivity_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = conductivity) # linear model with only water temp +summary(sqrt_conductivity_model_temp) +check_normality(sqrt_conductivity_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(sqrt_conductivity_model_synergy, sqrt_conductivity_model_additive, sqrt_conductivity_model_precip, sqrt_conductivity_model_temp) # additive model has lowest AIC + +# Box cox transformation +lambda_conductivity <- BoxCox.lambda(conductivity$Result) # find the optimal lambda +transformed_conductivity <- BoxCox(conductivity$Result, lambda_conductivity) # transform raw values using lambda +conductivity$box_cox_transformed = transformed_conductivity # make new column in dataset +View(conductivity) + +shapiro.test(conductivity$box_cox_transformed) # non-normal, p = 0.000164 + +# Regressions - box cox transformed conductivity +box_cox_conductivity_model_synergy <- lm(box_cox_transformed ~ Total_Precipitation * Mean_Water_Temp, data = conductivity) # linear model with both predictors and "*" interaction +summary(box_cox_conductivity_model_synergy) +check_normality(box_cox_conductivity_model_synergy) # non-normality of residuals detected (p < .001) + +box_cox_conductivity_model_additive <- lm(box_cox_transformed ~ Total_Precipitation + Mean_Water_Temp, data = conductivity) # linear model with both predictors and "+" interaction +summary(box_cox_conductivity_model_additive) +check_normality(box_cox_conductivity_model_additive) # non-normality of residuals detected (p < .001) + +box_cox_conductivity_model_precip <- lm(box_cox_transformed ~ Total_Precipitation, data = conductivity) # linear model with only precip +summary(box_cox_conductivity_model_precip) +check_normality(box_cox_conductivity_model_precip) # non-normality of residuals detected (p < .001) + +box_cox_conductivity_model_temp <- lm(box_cox_transformed ~ Mean_Water_Temp, data = conductivity) # linear model with only water temp +summary(box_cox_conductivity_model_temp) +check_normality(box_cox_conductivity_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(box_cox_conductivity_model_synergy, box_cox_conductivity_model_additive, box_cox_conductivity_model_precip, box_cox_conductivity_model_temp) # additive model has lowest AIC + +# Robust regression +conductivity_rlm_synergy <- rlm(Result ~ Total_Precipitation * Mean_Water_Temp, data = conductivity) # rlm model with both predictors and "*" interaction +summary(conductivity_rlm_synergy) + +conductivity_rlm_additive <- rlm(Result ~ Total_Precipitation + Mean_Water_Temp, data = conductivity) # rlm model with both predictors and "+" interaction +summary(conductivity_rlm_additive) + +conductivity_rlm_precip <- rlm(Result ~ Total_Precipitation, data = conductivity) # rlm model with only precip +summary(conductivity_rlm_precip) + +conductivity_rlm_temp <- rlm(Result ~ Mean_Water_Temp, data = conductivity) # rlm model with only temp +summary(conductivity_rlm_temp) + +compare_performance(conductivity_rlm_synergy, conductivity_rlm_additive, conductivity_rlm_precip, conductivity_rlm_temp) # additive model has lowest AIC + +# Plot conductivity +ggplot(conductivity, aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Mean water temperature (C)", y = "Conductivity (uS/cm)") + + theme_minimal() + +ggplot(conductivity, aes(x = Total_Precipitation, y = Result)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Total precipitation (mm)", y = "Conductivity (uS/cm)") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(conductivity_rlm_additive) + +## Dissolved oxygen regression ------------------------------------------------- +do <- read.csv("./data/water_quality/do.csv") + +# Visualize data +do %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "Dissolved oxygen (mg/L)") + + theme_minimal() + +do %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "Dissolved oxygen (mg/L)") + + theme_minimal() + +# Summary statistics +summary(do$Result) +summary(do$Total_Precipitation) +summary(do$Mean_Water_Temp) + +# Histograms +do %>% # raw - right skew + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 1) + + labs(x = "Dissolved oxygen (mg/L)", y = "Frequency") + +do %>% # ln transformed - normal + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Ln transformed dissolved oxygen (mg/L)", y = "Frequency") + +do %>% # log transformed - right skew + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.05) + + labs(x = "Log transformed dissolved oxygen (mg/L)", y = "Frequency") + +do %>% # sqrt transformed - right skew + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.1) + + labs(x = "Sqrt transformed dissolved oxygen (mg/L)", y = "Frequency") + +# Check normality +shapiro_do <- shapiro.test(do$Result) %>% print() # borderline normal, p = 0.04306 +shapiro_do_ln <- shapiro.test(do$ln_transformed) %>% print() # normal, p = 0.5089 +shapiro_do_log <- shapiro.test(do$log_transformed) %>% print() # normal, p = 0.5089 +shapiro_do_sqrt <- shapiro.test(do$sqrt_transformed) %>% print() # normal, p = 0.2771 + +# Regressions - raw do +do_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = do) # linear model with both predictors and "*" interaction +summary(do_model_synergy) +check_normality(do_model_synergy) # non-normality of residuals detected (p < .001) + +do_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = do) # linear model with both predictors and "+" interaction +summary(do_model_additive) +check_normality(do_model_additive) # non-normality of residuals detected (p < .001) + +do_model_precip <- lm(Result ~ Total_Precipitation, data = do) # linear model with only precip +summary(do_model_precip) +check_normality(do_model_precip) # residuals appear as normally distributed (p = 0.104) + +do_model_temp <- lm(Result ~ Mean_Water_Temp, data = do) # linear model with only water temp +summary(do_model_temp) +check_normality(do_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(do_model_synergy, do_model_additive, do_model_precip, do_model_temp) # additive model has lowest AIC + +# Regressions - ln transformed do +ln_do_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = do) # linear model with both predictors and "*" interaction +summary(ln_do_model_synergy) +check_normality(ln_do_model_synergy) # non-normality of residuals detected (p = 0.002) + +ln_do_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = do) # linear model with both predictors and "+" interaction +summary(ln_do_model_additive) +check_normality(ln_do_model_additive) # non-normality of residuals detected (p < .001) + +ln_do_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = do) # linear model with only precip +summary(ln_do_model_precip) +check_normality(ln_do_model_precip) # residuals appear as normally distributed (p = 0.539) + +ln_do_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = do) # linear model with only water temp +summary(ln_do_model_temp) +check_normality(ln_do_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(ln_do_model_synergy, ln_do_model_additive, ln_do_model_precip, ln_do_model_temp) # synergistic model has lowest AIC + +# Regressions - log transformed do +log_do_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = do) # linear model with both predictors and "*" interaction +summary(log_do_model_synergy) +check_normality(log_do_model_synergy) # non-normality of residuals detected (p = 0.002) + +log_do_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = do) # linear model with both predictors and "+" interaction +summary(log_do_model_additive) +check_normality(log_do_model_additive) # non-normality of residuals detected (p < .001) + +log_do_model_precip <- lm(log_transformed ~ Total_Precipitation, data = do) # linear model with only precip +summary(log_do_model_precip) +check_normality(log_do_model_precip) # residuals appear as normally distributed (p = 0.539) + +log_do_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = do) # linear model with only water temp +summary(log_do_model_temp) +check_normality(log_do_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(log_do_model_synergy, log_do_model_additive, log_do_model_precip, log_do_model_temp) # synergistic model has lowest AIC + +# Regressions - sqrt transformed do +sqrt_do_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = do) # linear model with both predictors and "*" interaction +summary(sqrt_do_model_synergy) +check_normality(sqrt_do_model_synergy) # non-normality of residuals detected (p = 0.001) + +sqrt_do_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = do) # linear model with both predictors and "+" interaction +summary(sqrt_do_model_additive) +check_normality(sqrt_do_model_additive) # non-normality of residuals detected (p < .001) + +sqrt_do_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = do) # linear model with only precip +summary(sqrt_do_model_precip) +check_normality(sqrt_do_model_precip) # residuals appear as normally distributed (p = 0.401) + +sqrt_do_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = do) # linear model with only water temp +summary(sqrt_do_model_temp) +check_normality(sqrt_do_model_temp) # non-normality of residuals detected (p < .001) + +compare_performance(sqrt_do_model_synergy, sqrt_do_model_additive, sqrt_do_model_precip, sqrt_do_model_temp) # synergistic model has lowest AIC + +# Compare performance of all models with normal residuals +compare_performance(do_model_precip, ln_do_model_precip, log_do_model_precip, sqrt_do_model_precip) # log_do_model_precip has lowest AIC + +# Plot do +ggplot(do, aes(x = Total_Precipitation, y = log_transformed)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Total precipitation (mm)", y = "Dissolved oxygen (mg/L)") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(log_do_model_precip) + +## pH regression --------------------------------------------------------------- +ph <- read.csv("./data/water_quality/ph.csv") + +# Visualize data +ph %>% + ggplot(aes(x = Total_Precipitation, y = Result)) + + geom_point() + + labs(x = "Total Precipitation (over previous 36 hours)", + y = "pH") + + theme_minimal() + +ph %>% + ggplot(aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + labs(x = "Mean water temp (over previous 36 hours)", + y = "pH") + + theme_minimal() + +# Summary statistics +summary(ph$Result) +summary(ph$Total_Precipitation) +summary(ph$Mean_Water_Temp) + +# Histograms +ph %>% # raw - slight right skew + ggplot(aes(x = Result)) + + geom_histogram(binwidth = 0.1) + + labs(x = "pH", y = "Frequency") + +ph %>% # ln transformed - approximately normal + ggplot(aes(x = ln_transformed)) + + geom_histogram(binwidth = 0.01) + + labs(x = "Ln transformed pH", y = "Frequency") + +ph %>% # log transformed - approximately normal + ggplot(aes(x = log_transformed)) + + geom_histogram(binwidth = 0.01) + + labs(x = "Log transformed pH", y = "Frequency") + +ph %>% # sqrt transformed - approximately normal + ggplot(aes(x = sqrt_transformed)) + + geom_histogram(binwidth = 0.01) + + labs(x = "Square root transformed pH", y = "Frequency") + +# Check normality +shapiro_ph <- shapiro.test(ph$Result) %>% print() # normal, p = 0.07346 +shapiro_ph_ln <- shapiro.test(ph$ln_transformed) %>% print() # normal, p = 0.1438 +shapiro_ph_log <- shapiro.test(ph$log_transformed) %>% print() # normal, p = 0.1438 +shapiro_ph_sqrt <- shapiro.test(ph$sqrt_transformed) %>% print() # normal, p = 0.1046 + +# Regressions - raw pH +ph_model_synergy <- lm(Result ~ Total_Precipitation * Mean_Water_Temp, data = ph) # linear model with both predictors and "*" interaction +summary(ph_model_synergy) +check_normality(ph_model_synergy) # non-normality of residuals detected (p = 0.002) + +ph_model_additive <- lm(Result ~ Total_Precipitation + Mean_Water_Temp, data = ph) # linear model with both predictors and "+" interaction +summary(ph_model_additive) +check_normality(ph_model_additive) # non-normality of residuals detected (p = 0.002) + +ph_model_precip <- lm(Result ~ Total_Precipitation, data = ph) # linear model with only precip +summary(ph_model_precip) +check_normality(ph_model_precip) # non-normality of residuals detected (p = 0.008) + +ph_model_temp <- lm(Result ~ Mean_Water_Temp, data = ph) # linear model with only water temp +summary(ph_model_temp) +check_normality(ph_model_temp) # non-normality of residuals detected (p = 0.007) + +compare_performance(ph_model_synergy, ph_model_additive, ph_model_precip, ph_model_temp) # temp model has lowest AIC + +# Regressions - ln transformed pH +ln_ph_model_synergy <- lm(ln_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ph) # linear model with both predictors and "*" interaction +summary(ln_ph_model_synergy) +check_normality(ln_ph_model_synergy) # non-normality of residuals detected (p = 0.004) + +ln_ph_model_additive <- lm(ln_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ph) # linear model with both predictors and "+" interaction +summary(ln_ph_model_additive) +check_normality(ln_ph_model_additive) # non-normality of residuals detected (p = 0.004) + +ln_ph_model_precip <- lm(ln_transformed ~ Total_Precipitation, data = ph) # linear model with only precip +summary(ln_ph_model_precip) +check_normality(ln_ph_model_precip) # non-normality of residuals detected (p = 0.018) + +ln_ph_model_temp <- lm(ln_transformed ~ Mean_Water_Temp, data = ph) # linear model with only water temp +summary(ln_ph_model_temp) +check_normality(ln_ph_model_temp) # non-normality of residuals detected (p = 0.014) + +compare_performance(ln_ph_model_synergy, ln_ph_model_additive, ln_ph_model_precip, ln_ph_model_temp) # additive and temp models have lowest AIC + +# Regressions - log transformed pH +log_ph_model_synergy <- lm(log_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ph) # linear model with both predictors and "*" interaction +summary(log_ph_model_synergy) +check_normality(log_ph_model_synergy) # non-normality of residuals detected (p = 0.004) + +log_ph_model_additive <- lm(log_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ph) # linear model with both predictors and "+" interaction +summary(log_ph_model_additive) +check_normality(log_ph_model_additive) # non-normality of residuals detected (p = 0.004) + +log_ph_model_precip <- lm(log_transformed ~ Total_Precipitation, data = ph) # linear model with only precip +summary(log_ph_model_precip) +check_normality(log_ph_model_precip) # non-normality of residuals detected (p = 0.018) + +log_ph_model_temp <- lm(log_transformed ~ Mean_Water_Temp, data = ph) # linear model with only water temp +summary(log_ph_model_temp) +check_normality(log_ph_model_temp) # non-normality of residuals detected (p = 0.014) + +compare_performance(log_ph_model_synergy, log_ph_model_additive, log_ph_model_precip, log_ph_model_temp) # additive and temp models have lowest AIC + +# Regressions - sqrt transformed ph +sqrt_ph_model_synergy <- lm(sqrt_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ph) # linear model with both predictors and "*" interaction +summary(sqrt_ph_model_synergy) +check_normality(sqrt_ph_model_synergy) # non-normality of residuals detected (p = 0.003) + +sqrt_ph_model_additive <- lm(sqrt_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ph) # linear model with both predictors and "+" interaction +summary(sqrt_ph_model_additive) +check_normality(sqrt_ph_model_additive) # non-normality of residuals detected (p = 0.003) + +sqrt_ph_model_precip <- lm(sqrt_transformed ~ Total_Precipitation, data = ph) # linear model with only precip +summary(sqrt_ph_model_precip) +check_normality(sqrt_ph_model_precip) # non-normality of residuals detected (p = 0.012) + +sqrt_ph_model_temp <- lm(sqrt_transformed ~ Mean_Water_Temp, data = ph) # linear model with only water temp +summary(sqrt_ph_model_temp) +check_normality(sqrt_ph_model_temp) # non-normality of residuals detected (p = 0.010) + +compare_performance(sqrt_ph_model_synergy, sqrt_ph_model_additive, sqrt_ph_model_precip, sqrt_ph_model_temp) # temp model has lowest AIC + +# Box cox transformation +lambda_ph <- BoxCox.lambda(ph$Result) # find the optimal lambda +transformed_ph <- BoxCox(ph$Result, lambda_ph) # transform raw values using lambda +ph$box_cox_transformed = transformed_ph # make new column in dataset +View(ph) + +shapiro.test(ph$box_cox_transformed) # normal, p = 0.2425 + +# Regressions - box cox transformed ph +box_cox_ph_model_synergy <- lm(box_cox_transformed ~ Total_Precipitation * Mean_Water_Temp, data = ph) # linear model with both predictors and "*" interaction +summary(box_cox_ph_model_synergy) +check_normality(box_cox_ph_model_synergy) # non-normality of residuals detected (p = 0.009) + +box_cox_ph_model_additive <- lm(box_cox_transformed ~ Total_Precipitation + Mean_Water_Temp, data = ph) # linear model with both predictors and "+" interaction +summary(box_cox_ph_model_additive) +check_normality(box_cox_ph_model_additive) # non-normality of residuals detected (p = 0.008) + +box_cox_ph_model_precip <- lm(box_cox_transformed ~ Total_Precipitation, data = ph) # linear model with only precip +summary(box_cox_ph_model_precip) +check_normality(box_cox_ph_model_precip) # non-normality of residuals detected (p = 0.037) + +box_cox_ph_model_temp <- lm(box_cox_transformed ~ Mean_Water_Temp, data = ph) # linear model with only water temp +summary(box_cox_ph_model_temp) +check_normality(box_cox_ph_model_temp) # non-normality of residuals detected (p = 0.026) + +compare_performance(box_cox_ph_model_synergy, box_cox_ph_model_additive, box_cox_ph_model_precip, box_cox_ph_model_temp) # additive model has lowest AIC + +# Robust regression +ph_rlm_synergy <- rlm(Result ~ Total_Precipitation * Mean_Water_Temp, data = ph) # rlm model with both predictors and "*" interaction +summary(ph_rlm_synergy) + +ph_rlm_additive <- rlm(Result ~ Total_Precipitation + Mean_Water_Temp, data = ph) # rlm model with both predictors and "+" interaction +summary(ph_rlm_additive) + +ph_rlm_precip <- rlm(Result ~ Total_Precipitation, data = ph) # rlm model with only precip +summary(ph_rlm_precip) + +ph_rlm_temp <- rlm(Result ~ Mean_Water_Temp, data = ph) # rlm model with only temp +summary(ph_rlm_temp) + +compare_performance(ph_rlm_synergy, ph_rlm_additive, ph_rlm_precip, ph_rlm_temp) # temp model has lowest AIC + +# Plot ph +ggplot(ph, aes(x = Mean_Water_Temp, y = Result)) + + geom_point() + + geom_smooth(method=lm, color="darkorchid4") + + labs(x = "Mean water temperature (C)", y = "pH") + + theme_minimal() + +par(mfrow = c(2, 2)) +plot(ph_rlm_temp) + +## Air and water temp regression ----------------------------------------------- +# Visualize data +combined_daily_avg %>% + ggplot(aes(x = daily_avg_air_temp, y = daily_avg_water_temp)) + + geom_point() + + labs(x = "Daily average air temperature (C)", + y = "Daily average water temperature (C)") + + theme_minimal() + +# Summary statistics +summary(combined_daily_avg$daily_avg_air_temp) +summary(combined_daily_avg$daily_avg_water_temp) + +# Histograms +combined_daily_avg %>% # raw - bimodal (summer and winter peaks) + ggplot(aes(x = daily_avg_air_temp)) + + geom_histogram(binwidth = 1) + + labs(x = "Daily average air temperature (C)", y = "Frequency") + +combined_daily_avg %>% # raw - left skew + ggplot(aes(x = daily_avg_water_temp)) + + geom_histogram(binwidth = 1) + + labs(x = "Daily average water temperature (C)", y = "Frequency") + +combined_daily_avg %>% # ln transformed - left skew + ggplot(aes(x = ln_transformed_air)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Ln transformed daily average air temperature (ln[C])", y = "Frequency") + +combined_daily_avg %>% # ln transformed - left skew + ggplot(aes(x = ln_transformed_water)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Ln transformed daily average water temperature (ln[C])", y = "Frequency") + +combined_daily_avg %>% # log transformed - left skew + ggplot(aes(x = log_transformed_air)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Log transformed daily average air temperature (log[C])", y = "Frequency") + +combined_daily_avg %>% # log transformed - left skew + ggplot(aes(x = log_transformed_water)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Log transformed daily average water temperature (log[C])", y = "Frequency") + +combined_daily_avg %>% # sqrt transformed - left skew + ggplot(aes(x = sqrt_transformed_air)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Square root transformed daily average air temperature (sqrt[C])", y = "Frequency") + +combined_daily_avg %>% # sqrt transformed - left skew + ggplot(aes(x = sqrt_transformed_water)) + + geom_histogram(binwidth = 0.5) + + labs(x = "Square root transformed daily average water temperature (sqrt[C])", y = "Frequency") + +# Check normality with Anderson-Darling test (too many values for a Shapiro test) +ad.test(combined_daily_avg$daily_avg_air_temp) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$daily_avg_water_temp) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$ln_transformed_air) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$ln_transformed_water) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$log_transformed_air) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$log_transformed_water) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$sqrt_transformed_air) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$sqrt_transformed_water) # non-normal, p < 2.2e-16 + +# Regressions +raw_temp_model <- lm(daily_avg_water_temp ~ daily_avg_air_temp, data = combined_daily_avg) # raw data +summary(raw_temp_model) +check_normality(raw_temp_model) # non-normality of residuals detected (p < .001) + +ln_temp_model <- lm(ln_transformed_water ~ ln_transformed_air, data = combined_daily_avg) # ln transformed data +summary(ln_temp_model) +check_normality(ln_temp_model) # non-normality of residuals detected (p < .001) + +log_temp_model <- lm(log_transformed_water ~ log_transformed_air, data = combined_daily_avg) # log transformed data +summary(log_temp_model) +check_normality(log_temp_model) # non-normality of residuals detected (p < .001) + +sqrt_temp_model <- lm(sqrt_transformed_water ~ sqrt_transformed_air, data = combined_daily_avg) # sqrt transformed data +summary(sqrt_temp_model) +check_normality(sqrt_temp_model) # non-normality of residuals detected (p < .001) + +compare_performance(raw_temp_model, ln_temp_model, log_temp_model, sqrt_temp_model) # log temp model has lowest AIC + +#Box cox transformation +lambda_air <- BoxCox.lambda(combined_daily_avg$daily_avg_air_temp) # find the optimal lambda for air temp +transformed_air_temp <- BoxCox(combined_daily_avg$daily_avg_air_temp, lambda_air) # transform raw air temp using lambda +combined_daily_avg$box_cox_transformed_air = transformed_air_temp # make new column in dataset + +lambda_water <- BoxCox.lambda(combined_daily_avg$daily_avg_water_temp) # find the optimal lambda for water temp +transformed_water_temp <- BoxCox(combined_daily_avg$daily_avg_water_temp, lambda_water) # transform raw water temp using lambda +combined_daily_avg$box_cox_transformed_water = transformed_water_temp # make new column in dataset + +View(combined_daily_avg) + +ad.test(combined_daily_avg$box_cox_transformed_air) # non-normal, p < 2.2e-16 +ad.test(combined_daily_avg$box_cox_transformed_water) # non-normal, p < 2.2e-16 + +# Regression - box cox transformed temperature +box_cox_model <- lm(box_cox_transformed_water ~ box_cox_transformed_air, data = combined_daily_avg) +summary(box_cox_model) +check_normality(box_cox_model) # non-normality of residuals detected (p < .001) + +# Robust regression +temp_rlm_model <- rlm(daily_avg_water_temp ~ daily_avg_air_temp, data = combined_daily_avg) +summary(temp_rlm_model) + +# Plot temperature relationship +combined_daily_avg %>% + ggplot(aes(x = daily_avg_air_temp, y = daily_avg_water_temp)) + + geom_point(shape = 16) + + labs(x = "Daily Average Air Temperature (C)", + y = "Daily Average Water Temperature (C)") + + theme_minimal()+ + geom_smooth(method="lm", colour = "royalblue") + +par(mfrow = c(2, 2)) +plot(temp_rlm_model) diff --git a/code/water_flow.R b/code/water_flow.R new file mode 100644 index 0000000..7798c0c --- /dev/null +++ b/code/water_flow.R @@ -0,0 +1,242 @@ +# WATER FLOW + +# Load packages ---------------------------------------------------------------- +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +if (!require(remotes, quietly = TRUE)){ + install.packages("remotes") + library(remotes) +} + +if (!require(ContDataQC, quietly = TRUE)){ + install.packages("ContDataQC") + library(ContDataQC) +} + +## Import data ----------------------------------------------------------------- +# Read Excel files and combine sheets +SR10_file_path <- "./data/water_flow/SR10_raw_flow.xlsx" # define file path +ABF_file_path <- "./data/water_flow/ABF_raw_flow.xlsx" # define file path + +SR10_sheet_names <- excel_sheets(SR10_file_path) # define sheet names +ABF_sheet_names <- excel_sheets(ABF_file_path) # define sheet names + +SR10_list <- lapply(SR10_sheet_names, function(SR10_sheet_names) { # read each sheet and store in a list + read_excel(SR10_file_path, sheet = SR10_sheet_names) +}) +ABF_list <- lapply(ABF_sheet_names, function(ABF_sheet_names) { # reach each sheet and store in a list + read_excel(ABF_file_path, sheet = ABF_sheet_names) +}) + +SR10_combined_data <- bind_rows(SR10_list) # combine all data frames +ABF_combined_data <- bind_rows(ABF_list) # combine all data frames + +## Data prep ------------------------------------------------------------------- +# Check for missing values +sum(is.na(SR10_combined_data)) +sum(is.na(ABF_combined_data)) + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) + +years_SR10 <- unique(stringr::str_extract(SR10_sheet_names, "\\d{4}")) + +years_ABF <- unique(stringr::str_extract(ABF_sheet_names, "\\d{4}")) + +# Identify missing years for Side Road 10 +missing_SR10 <- (setdiff(year_range, years_SR10)) +print(missing_SR10) + +# Identify missing years for Aberfoyle +missing_ABF <- (setdiff(year_range, years_ABF)) +print(missing_ABF) + +# Convert Timestamp and extract year and month for Side Road 10 +SR10_combined_data <- SR10_combined_data %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Convert Timestamp and extract year and month for Aberfoyle +ABF_combined_data <- ABF_combined_data %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +## Aggregate data by year and month, and get metrics +# Aggregate data for Side Road 10 +SR10_results <- SR10_combined_data %>% + group_by(Year, Month) %>% + summarise(Minimum = min(Value, na.rm = TRUE), + Maximum = max(Value, na.rm = TRUE), + Average = mean(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +# Aggregate data for Aberfoyle +ABF_results <- ABF_combined_data %>% + group_by(Year, Month) %>% + summarise(Minimum = min(Value, na.rm = TRUE), + Maximum = max(Value, na.rm = TRUE), + Average = mean(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +## Export results as csv files into the R project +write.csv(SR10_results, "./data/water_flow/SR10_summarized_flow.csv") +write.csv(ABF_results, "./data/water_flow/ABF_summarized_flow.csv") + +## Most extreme values --------------------------------------------------------- +# Identify 5 highest average flow months for Side Road 10 +high5_SR10 <- SR10_results %>% + arrange(desc(Average)) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(high5_SR10) + +## Identify 5 highest average flow months for Aberfoyle +high5_ABF <- ABF_results %>% + arrange(desc(Average)) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(high5_ABF) + +## Comparing gauges ------------------------------------------------------------ +mean(ABF_combined_data$Value) +sd(ABF_combined_data$Value) + +mean(SR10_combined_data$Value) +sd(SR10_combined_data$Value) + +# Test normality +shapiro.test(SR10_results$Average) # non-normal, p-value = 3.484e-10 +shapiro.test(ABF_results$Average) # non-normal, p-value = 2.484e-11 + +# Compare annual average flow between the gauges +SR10_annual_flow <- SR10_combined_data %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +ABF_annual_flow <- ABF_combined_data %>% + group_by(Year) %>% + summarise(Mean = mean(Value, na.rm = TRUE), + .groups = 'drop') + +# Remove years with incomplete flow data +SR10_annual_flow <- SR10_annual_flow %>% + filter(!Year %in% c(1999)) # remove incomplete years + +ABF_annual_flow <- ABF_annual_flow %>% + filter(!Year %in% c(2002,2020)) # remove incomplete years + +gauge_flow <- wilcox.test(SR10_annual_flow$Mean, ABF_annual_flow$Mean, var.equal = TRUE) +print(gauge_flow) + +nrow(ABF_annual_flow) +nrow(SR10_annual_flow) + +# Effect size +mean(SR10_annual_flow$Mean) - mean(ABF_annual_flow$Mean) + +## Flashiness ------------------------------------------------------------------ + +# Based on: "A New Flashiness Index: Characteristics and Applications to Midwestern Rivers and Streams" + +# Side Rd 10 +# Convert Timestamp to Date format and calculate daily mean flow +SR10_daily_flow <- SR10_combined_data %>% + mutate(Date = as.Date(Timestamp)) %>% + group_by(Year, Date) %>% + summarize(DailyMeanFlow = mean(Value), .groups = 'drop') + +# Calculate overall RBI - value of 0.17 for a watershed of 104 sq km means that it is on the stable end of the continuum +SR10_RBI <- RBIcalc(SR10_daily_flow$DailyMeanFlow) +print(SR10_RBI) + +# Aberfoyle +ABF_daily_flow <- ABF_combined_data %>% + mutate(Date = as.Date(Timestamp)) %>% + group_by(Year, Date) %>% + summarize(DailyMeanFlow = mean(Value), .groups = 'drop') + +# Calculate overall RBI - value of 0.2 for a watershed of 104 sq km means that it is on the stable end of the continuum +ABF_RBI <- RBIcalc(ABF_daily_flow$DailyMeanFlow) +print(ABF_RBI) + +# Calculate annual RBI value, and assess changes over time +# Calculate day-to-day changes in flow, and their absolute values +SR10_daily_flow <- SR10_daily_flow %>% + mutate(Change = c(NA, diff(DailyMeanFlow)), + AbsChange = abs(Change)) + +ABF_daily_flow <- ABF_daily_flow %>% + mutate(Change = c(NA, diff(DailyMeanFlow)), + AbsChange = abs(Change)) + +# Calculate annual sums of absolute changes and total annual flows +SR10_annual_flow <- SR10_daily_flow %>% + group_by(Year) %>% + summarize(SumAbsChanges = sum(AbsChange, na.rm = TRUE), + TotalFlow = sum(DailyMeanFlow), + FlashinessIndex = SumAbsChanges / TotalFlow) + +View(SR10_annual_flow) + +ABF_annual_flow <- ABF_daily_flow %>% + group_by(Year) %>% + summarize(SumAbsChanges = sum(AbsChange, na.rm = TRUE), + TotalFlow = sum(DailyMeanFlow), + FlashinessIndex = SumAbsChanges / TotalFlow) + +View(ABF_annual_flow) + +# Export annual flashiness dataframes +write.csv(SR10_annual_flow, "./data/water_flow/SR10_annual_flashiness.csv") + +write.csv(ABF_annual_flow, "./data/water_flow/ABF_annual_flashiness.csv") + +SR10_annual_flashiness <- read.csv("./data/water_flow/SR10_annual_flashiness.csv") +ABF_annual_flashiness <- read.csv("./data/water_flow/ABF_annual_flashiness.csv") + +# Remove years with incomplete flashiness data +SR10_annual_flashiness <- SR10_annual_flashiness %>% + filter(!Year %in% c(1999)) #remove incomplete years + +ABF_annual_flashiness <- ABF_annual_flashiness %>% + filter(!Year %in% c(2002,2020)) #remove incomplete years + +# Plotting the BCI value over years +ggplot(SR10_annual_flashiness, aes(x = Year, y = FlashinessIndex)) + + geom_line(group = 1, color = "black", linetype=2) + + geom_point(color = "black") + + labs(x = "Year", y = "Flashiness Index") + + theme_minimal() + +ggplot(ABF_annual_flashiness, aes(x = Year, y = FlashinessIndex)) + + geom_line(group = 1, color = "black", linetype=2) + + geom_point(color = "black") + + labs(x = "Year", y = "Flashiness Index") + + theme_minimal() + +# Comparing gauges +# Test normality +shapiro.test(SR10_annual_flashiness$FlashinessIndex) # non-normal, p-value = 0.001641 +shapiro.test(ABF_annual_flashiness$FlashinessIndex) # normal, p-value = 0.08487 + +# Compare annual flashiness between the gauges - significant +gauge_flashiness <- wilcox.test(SR10_annual_flashiness$FlashinessIndex, ABF_annual_flashiness$FlashinessIndex, var.equal = TRUE) +print(gauge_flashiness) + +# Effect size +mean(ABF_annual_flashiness$FlashinessIndex) - mean(SR10_annual_flashiness$FlashinessIndex) + + diff --git a/code/water_temp.R b/code/water_temp.R new file mode 100644 index 0000000..9c7af49 --- /dev/null +++ b/code/water_temp.R @@ -0,0 +1,164 @@ +# WATER TEMPERATURE + +## Load packages --------------------------------------------------------------- +if (!require(readxl, quietly = TRUE)) { + install.packages("readxl") + library(readxl)} + +if (!require(tidyverse, quietly = TRUE)) { + install.packages("tidyverse") + library(tidyverse)} + +## Import data ----------------------------------------------------------------- +# Read Excel files and combine sheets +SR10_file_path <- "./data/water_temp/SR10_raw_water_temp.xlsx" # define file path +ABF_file_path <- "./data/water_temp/ABF_raw_water_temp.xlsx" # define file path + +SR10_sheet_names <- excel_sheets(SR10_file_path) # define sheet names +ABF_sheet_names <- excel_sheets(ABF_file_path) # define sheet names + +SR10_list <- lapply(SR10_sheet_names, function(SR10_sheet_names) { # read each sheet and store in a list + read_excel(SR10_file_path, sheet = SR10_sheet_names) +}) +ABF_list <- lapply(ABF_sheet_names, function(ABF_sheet_names) { # read each sheet and store in a list + read_excel(ABF_file_path, sheet = ABF_sheet_names) +}) + +SR10_combined_data <- bind_rows(SR10_list) # combine all data frames +ABF_combined_data <- bind_rows(ABF_list) # combine all data frames + +## Data prep ------------------------------------------------------------------- +# Adjust precision for Side Road 10 so all values have 1 decimal place +SR10_combined_data <- SR10_combined_data %>% + mutate(Value = round(Value, 1)) + +# Adjust precision for Aberfoyle so all values have 1 decimal place +ABF_combined_data <- ABF_combined_data %>% + mutate(Value = round(Value, 1)) + +# Check for missing values +sum(is.na(SR10_combined_data)) +sum(is.na(ABF_combined_data)) + +# Identify which years are missing, from 1996-2023 +year_range <- as.character(1996:2023) + +years_SR10 <- unique(stringr::str_extract(SR10_sheet_names, "\\d{4}")) + +years_ABF <- unique(stringr::str_extract(ABF_sheet_names, "\\d{4}")) + +# Identify missing years for Side Road 10 +missing_SR10 <- (setdiff(year_range, years_SR10)) +print(missing_SR10) + +# Identify missing years for Side Road 10 +missing_ABF <- (setdiff(year_range, years_ABF)) +print(missing_ABF) + +# Convert Timestamp and extract year and month for Side Road 10 +SR10_combined_data <- SR10_combined_data %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Convert Timestamp and extract year and month for Aberfoyle +ABF_combined_data <- ABF_combined_data %>% + mutate(Timestamp = ymd_hms(Timestamp), + Year = year(Timestamp), + Month = month(Timestamp)) + +# Aggregate data by year and month, and get metrics +# Aggregate data for Side Road 10 +SR10_results <- SR10_combined_data %>% + group_by(Year, Month) %>% + summarise(Minimum = min(Value, na.rm = TRUE), + Maximum = max(Value, na.rm = TRUE), + Average = mean(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +# Aggregate data for Aberfoyle +ABF_results <- ABF_combined_data %>% + group_by(Year, Month) %>% + summarise(Minimum = min(Value, na.rm = TRUE), + Maximum = max(Value, na.rm = TRUE), + Average = mean(Value, na.rm = TRUE), + Num_Samples = n(), + .groups = 'drop') + +## Export results as csv files into the R project +write.csv(SR10_results, "./data/water_temp/SR10_summarized_water_temp.csv") +write.csv(ABF_results, "./data/water_temp/ABF_summarized_water_temp.csv") + +## Most extreme values --------------------------------------------------------- +# Identify 5 highest average temp months for Side Road 10 +hot5_SR10 <- SR10_results %>% + arrange(desc(Average)) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(hot5_SR10) + +# Identify 5 lowest average temp months for Side Road 10 +cold5_SR10 <- SR10_results %>% + arrange(Average) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(cold5_SR10) + +# Identify 5 highest average temp months for Aberfoyle +hot5_ABF <- ABF_results %>% + arrange(desc(Average)) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(hot5_ABF) + +# Identify 5 lowest average temp months for Aberfoyle +cold5_ABF <- ABF_results %>% + arrange(Average) %>% + slice_head(n = 5) %>% + select(Year, Month, Average) + +print(cold5_ABF) + +## Comparing gauges ------------------------------------------------------------ +# Test normality +shapiro.test(SR10_results$Average) # non-normal, p-value = 3.484e-10 +shapiro.test(SR10_results$Maximum) # non-normal, p-value = 1.773e-15 +shapiro.test(ABF_results$Average) # non-normal, p-value = 2.484e-11 +shapiro.test(ABF_results$Maximum) # non-normal, p-value = 1.844e-09 + +# Compare average monthly temp betweeen the two gauge stations +gauge_wt_avg <- wilcox.test(SR10_results$Average, ABF_results$Average, var.equal = TRUE) +print(gauge_wt_avg) + +# Compare maximum monthly temp betweeen the two gauge stations +gauge_wt_max <- wilcox.test(SR10_results$Maximum, ABF_results$Maximum, var.equal = TRUE) +print(gauge_wt_max) + +# Effect size +mean(ABF_results$Maximum) - mean(SR10_results$Maximum) + +## Historical data ------------------------------------------------------------- +# Mann-Whitney test of 1994 vs. 2023 summer data, see p. 117 in 1996 report +mc11_summer_1994_monthly_avg <- c(6.0, 11.3, 15.2, 17.6, 16.6, 11.1, 7.6) + +mc04_summer_1994_monthly_avg <- c(5.8, 13.1, 17.4, 21.7, 18.8, 16.2, 11.3) + +SR10_summer_2023 <- SR10_results %>% + filter(Year == 2023, Month >= 4, Month <= 10) + +SR10_summer_2023_monthly_avg <- SR10_summer_2023$Average + +ABF_summer_2023 <- ABF_results %>% + filter(Year == 2023, Month >= 4, Month <= 10) + +ABF_summer_2023_monthly_avg <- ABF_summer_2023$Average + +SR10_mann_whitney_test <- wilcox.test(mc11_summer_1994_monthly_avg, SR10_summer_2023_monthly_avg) +print(SR10_mann_whitney_test) + +ABF_mann_whitney_test <- wilcox.test(mc04_summer_1994_monthly_avg, ABF_summer_2023_monthly_avg) +print(ABF_mann_whitney_test) diff --git a/data/Ranger_restoration_activities.csv b/data/Ranger_restoration_activities.csv new file mode 100644 index 0000000..d09b8cb --- /dev/null +++ b/data/Ranger_restoration_activities.csv @@ -0,0 +1,197 @@ +Year,Restoration Work Performed +2003,Garbage removal +2003,Trail/Parking maintenance +2003,Repairs to restoration structures +2003,Deflector/Sweeper construction or installation +2003,Deflector/Sweeper construction or installation +2003,Obstruction removal +2003,Abiotic data collection +2003,Other +2004,Garbage removal +2004,Deflector/Sweeper construction or installation +2004,Trail/Parking maintenance +2004,Deflector/Sweeper construction or installation +2004,Obstruction removal +2004,Planting +2004,Obstruction removal +2004,Trail/Parking maintenance +2004,Vegetation management +2005,Trail/Parking maintenance +2005,Vegetation management +2005,Trail/Parking maintenance +2005,Obstruction removal +2005,Deflector/Sweeper construction or installation +2005,Vegetation management +2005,Obstruction removal +2005,Garbage removal +2005,Garbage removal +2005,Other +2005,Electrofishing +2006,Electrofishing +2006,Trail/Parking maintenance +2006,Repairs to restoration structures +2006,Vegetation management +2006,Trail/Parking maintenance +2006,Obstruction removal +2006,Garbage removal +2006,Deflector/Sweeper construction or installation +2006,Deflector/Sweeper construction or installation +2006,Other +2006,Vegetation management +2006,Planting +2006,Deflector/Sweeper construction or installation +2006,Abiotic data collection +2006,Vegetation management +2006,Deflector/Sweeper construction or installation +2007,Electrofishing +2007,Repairs to restoration structures +2007,Planting +2007,Trail/Parking maintenance +2007,Garbage removal +2007,Deflector/Sweeper construction or installation +2007,Obstruction removal +2007,Vegetation management +2007,Abiotic data collection +2008,Obstruction removal +2008,Deflector/Sweeper construction or installation +2008,Trail/Parking maintenance +2008,Garbage removal +2008,Obstruction removal +2008,Planting +2008,Deflector/Sweeper construction or installation +2008,Electrofishing +2008,Vegetation management +2008,Vegetation management +2008,Abiotic data collection +2009,Obstruction removal +2009,Deflector/Sweeper construction or installation +2009,Vegetation management +2009,Trail/Parking maintenance +2009,Obstruction removal +2009,Garbage removal +2009,Vegetation management +2009,Vegetation management +2009,Garbage removal +2009,Planting +2009,Other +2009,Deflector/Sweeper construction or installation +2009,Electrofishing +2009,Biotic data collection +2010,Obstruction removal +2010,Deflector/Sweeper construction or installation +2010,Trail/Parking maintenance +2010,Obstruction removal +2010,Vegetation management +2010,Vegetation management +2010,Garbage removal +2010,Planting +2010,Electrofishing +2010,Obstruction removal +2010,Deflector/Sweeper construction or installation +2010,Garbage removal +2010,Deflector/Sweeper construction or installation +2010,Obstruction removal +2010,Vegetation management +2010,Obstruction removal +2011,Obstruction removal +2011,Deflector/Sweeper construction or installation +2011,Vegetation management +2011,Obstruction removal +2011,Deflector/Sweeper construction or installation +2011,Other +2011,Planting +2011,Garbage removal +2012,Obstruction removal +2012,Deflector/Sweeper construction or installation +2012,Suitable fish habitat +2012,Electrofishing +2013,Garbage removal +2013,Planting +2013,Garbage removal +2013,Vegetation management +2013,Deflector/Sweeper construction or installation +2013,Suitable fish habitat +2013,Abiotic data collection +2013,Deflector/Sweeper construction or installation +2013,Obstruction removal +2013,Suitable fish habitat +2013,Electrofishing +2013,Electrofishing +2013,Obstruction removal +2013,Deflector/Sweeper construction or installation +2013,Obstruction removal +2014,Electrofishing +2014,Obstruction removal +2014,Deflector/Sweeper construction or installation +2014,Repairs to restoration structures +2014,Deflector/Sweeper construction or installation +2014,Obstruction removal +2014,Obstruction removal +2014,Invasive species management +2014,Other +2014,Trail/Parking maintenance +2014,Garbage removal +2015,Obstruction removal +2015,Deflector/Sweeper construction or installation +2015,Repairs to restoration structures +2015,Repairs to restoration structures +2015,Repairs to restoration structures +2015,Obstruction removal +2015,Electrofishing +2016,Obstruction removal +2016,Deflector/Sweeper construction or installation +2016,Repairs to restoration structures +2016,Deflector/Sweeper construction or installation +2016,Obstruction removal +2016,Electrofishing +2016,Garbage removal +2017,Obstruction removal +2017,Obstruction removal +2017,Deflector/Sweeper construction or installation +2017,Obstruction removal +2017,Invasive species management +2017,Obstruction removal +2017,Abiotic data collection +2017,Garbage removal +2017,Electrofishing +2018,Obstruction removal +2018,Deflector/Sweeper construction or installation +2018,Obstruction removal +2018,Vegetation management +2018,Trail/Parking maintenance +2018,Trail/Parking maintenance +2018,Obstruction removal +2018,Deflector/Sweeper construction or installation +2018,Electrofishing +2019,Trail/Parking maintenance +2019,Deflector/Sweeper construction or installation +2019,Obstruction removal +2019,Deflector/Sweeper construction or installation +2019,Obstruction removal +2019,Vegetation management +2019,Planting +2019,Electrofishing +2022,Obstruction removal +2022,Deflector/Sweeper construction or installation +2022,Suitable fish habitat +2022,Electrofishing +2022,Biotic data collection +2023,Obstruction removal +2023,Deflector/Sweeper construction or installation +2023,Obstruction removal +2023,Deflector/Sweeper construction or installation +2023,Invasive species management +2023,Repairs to restoration structures +2023,Garbage removal +2023,Biotic data collection +2023,Biotic data collection +2023,Biotic data collection +2023,Biotic data collection +2023,Electrofishing +2024,Obstruction removal +2024,Obstruction removal +2024,Obstruction removal +2024,Deflector/Sweeper construction or installation +2024,Trail/Parking maintenance +2024,Invasive species management +2024,Biotic data collection \ No newline at end of file diff --git a/data/Ranger_work_sites.csv b/data/Ranger_work_sites.csv new file mode 100644 index 0000000..1e491f0 --- /dev/null +++ b/data/Ranger_work_sites.csv @@ -0,0 +1,101 @@ +Location,Year +Shade's Mills,2003 +Shade's Mills,2004 +Shade's Mills,2006 +Shade's Mills,2007 +Shade's Mills,2013 +Shade's Mills,2014 +Shade's Mills,2017 +Shade's Mills,2018 +Shade's Mills,2019 +Shade's Mills,2023 +Shade's Mills,2024 +Bond Tract,2003 +Bond Tract,2004 +Bond Tract,2005 +Bond Tract,2006 +Bond Tract,2007 +Bond Tract,2008 +Bond Tract,2009 +Bond Tract,2010 +Bond Tract,2013 +Bond Tract,2015 +Bond Tract,2023 +Soper Park,2004 +Soper Park,2005 +Soper Park,2006 +Soper Park,2007 +Soper Park,2008 +Soper Park,2009 +Soper Park,2010 +Soper Park,2011 +Soper Park,2013 +Soper Park,2014 +Soper Park,2016 +Soper Park,2017 +Soper Park,2023 +McKinnon Property,2003 +McKinnon Property,2004 +McKinnon Property,2005 +McKinnon Property,2006 +McKinnon Property,2007 +McKinnon Property,2008 +Bulmer Farm,2004 +Bulmer Farm,2005 +Paddocks Property,2004 +Paddocks Property,2010 +Paddocks Property,2018 +Side Road 10 Gauge,2004 +Side Road 10 Gauge,2008 +Side Road 10 Gauge,2009 +Side Road 10 Gauge,2010 +Aberfoyle Gauge,2008 +Aberfoyle Gauge,2009 +Aberfoyle Gauge,2010 +McNie & Chen Property,2005 +McNie & Chen Property,2006 +Puslinch Community Centre,2005 +Puslinch Community Centre,2009 +Puslinch Community Centre,2018 +Puslinch Community Centre,2019 +Puslinch Community Centre,2022 +Ed Lake Property,2006 +Ed Lake Property,2008 +Ed Lake Property,2010 +Ed Lake Property,2011 +Ed Lake Property,2012 +Ed Lake Property,2013 +Ed Lake Property,2014 +Ed Lake Property,2015 +Ed Lake Property,2016 +Ed Lake Property,2017 +Ed Lake Property,2018 +Capital Paving Property,2006 +Capital Paving Property,2007 +Capital Paving Property,2008 +Capital Paving Property,2009 +Capital Paving Property,2010 +Capital Paving Property,2011 +Capital Paving Property,2013 +Capital Paving Property,2014 +Capital Paving Property,2016 +Capital Paving Property,2018 +Capital Paving Property,2023 +Capital Paving Property,2024 +McCrimmon Property,2012 +McCrimmon Property,2013 +McCrimmon Property,2014 +McCrimmon Property,2015 +McCrimmon Property,2016 +McCrimmon Property,2017 +McCrimmon Property,2018 +McCrimmon Property,2019 +Duscio Property,2010 +Duscio Property,2015 +Dufferin Aggregates Property,2009 +Dufferin Aggregates Property,2015 +Dufferin Aggregates Property,2023 +Kerr Street Bridge,2017 +Aberfoyle Tributary,2022 +Aberfoyle Tributary,2023 +CBM Lakes Property,2024 \ No newline at end of file diff --git a/data/STREAM_MILL CREEK GRCA_Taxonomic_Results_2023.xlsx b/data/STREAM_MILL CREEK GRCA_Taxonomic_Results_2023.xlsx new file mode 100644 index 0000000..03334b8 Binary files /dev/null and b/data/STREAM_MILL CREEK GRCA_Taxonomic_Results_2023.xlsx differ diff --git a/data/air_temp/CSM_air_temp_metadata.xlsx b/data/air_temp/CSM_air_temp_metadata.xlsx new file mode 100644 index 0000000..f4fd2c5 Binary files /dev/null and b/data/air_temp/CSM_air_temp_metadata.xlsx differ diff --git a/data/air_temp/CSM_raw_air_temp.xlsx b/data/air_temp/CSM_raw_air_temp.xlsx new file mode 100644 index 0000000..ce9ceff Binary files /dev/null and b/data/air_temp/CSM_raw_air_temp.xlsx differ diff --git a/data/air_temp/CSM_summarized_air_temp.csv b/data/air_temp/CSM_summarized_air_temp.csv new file mode 100644 index 0000000..b242b0e --- /dev/null +++ b/data/air_temp/CSM_summarized_air_temp.csv @@ -0,0 +1,257 @@ +"","Year","Month","Minimum","Maximum","Average","Num_Samples" +"1",2002,4,0.06,29.8,14.2822543352601,173 +"2",2002,5,1.29,28.98,13.0672235294118,425 +"3",2002,6,8.59,34.99,20.7521503759398,665 +"4",2002,7,11.88,35.06,23.8271382113821,615 +"5",2002,8,12.48,35.85,22.4830551626591,707 +"6",2002,9,7.09,35.83,19.6465797101449,690 +"7",2002,10,-1.74,27.78,9.19502923976608,684 +"8",2002,11,-6.27,15.9,3.40266666666667,690 +"9",2002,12,-16.24,8.66,-1.85215988779804,713 +"10",2003,1,-25.39,4.94,-7.22762973352034,713 +"11",2003,2,-23.86,8.03,-6.41090062111801,644 +"12",2003,3,-23.8,20.15,-0.0605189340813464,713 +"13",2003,4,-7.96,26.61,6.05601449275362,690 +"14",2003,5,3.39,23.73,12.6448106591865,713 +"15",2003,6,6.44,37.07,19.1736811594203,690 +"16",2003,7,12.82,34.73,22.1000561009818,713 +"17",2003,8,11.02,31.83,22.0815147265077,713 +"18",2003,9,3.8,28.54,16.8759275362319,690 +"19",2003,10,-1.37,25.11,8.9501683029453,713 +"20",2003,11,-5,18.19,5.08928985507246,690 +"21",2003,12,-11.51,9.99,-0.0539130434782609,713 +"22",2004,1,-23.63,12.82,-8.32666199158485,713 +"23",2004,2,-18.78,10.83,-3.42865067466267,667 +"24",2004,3,-11.45,17.7,1.99661991584853,713 +"25",2004,4,-5.58,23.18,7.2605652173913,690 +"26",2004,5,-0.09,29.69,13.9266058906031,713 +"27",2004,6,7.33,32.05,18.1959130434783,690 +"28",2004,7,11.97,31.99,20.9299438990182,713 +"29",2004,8,8.08,29.99,19.4916549789621,713 +"30",2004,9,6.7,29.19,18.0867971014493,690 +"31",2004,10,1.59,24.98,10.5196633941094,713 +"32",2004,11,-3.37,13.25,5.15630434782609,690 +"33",2004,12,-21.78,10.76,-2.53479663394109,713 +"34",2005,1,-26.32,15.98,-6.49468443197756,713 +"35",2005,2,-19.55,7.76,-3.75142857142857,644 +"36",2005,3,-17.23,18.28,-1.71664796633941,713 +"37",2005,4,-0.7,27.01,7.57142028985507,690 +"38",2005,5,0.56,26.74,12.0353576437588,713 +"39",2005,6,9.56,35.26,22.703347826087,690 +"40",2005,7,11.36,35.88,23.3205890603086,713 +"41",2005,8,9.5,32.47,20.3878698224852,676 +"42",2005,9,-54.99,30.42,15.1793043478261,690 +"43",2005,10,-54.99,19.17,-20.2300841514727,713 +"44",2005,11,-11.06,17.27,4.44089855072464,690 +"45",2005,12,-17.48,4.35,-4.02561009817672,713 +"46",2006,1,-12.57,9.72,-0.349270687237027,713 +"47",2006,2,-13.91,7.3,-4.1042701863354,644 +"48",2006,3,-11.22,20.14,0.283450210378682,713 +"49",2006,4,-3.92,23.63,8.04305797101449,690 +"50",2006,5,0.11,34.4,14.2848948106592,713 +"51",2006,6,7.55,32.73,19.3724782608696,690 +"52",2006,7,12.67,34.1,23.0303927068724,713 +"53",2006,8,10.1,34.69,20.4002945301543,713 +"54",2006,9,3.65,26.02,14.748347826087,690 +"55",2006,10,-0.43,22.74,8.16880785413745,713 +"56",2006,11,-4.19,14.77,4.70936231884058,690 +"57",2006,12,-12.7,10.45,1.1104347826087,713 +"58",2007,1,-19.49,10.77,-3.11656381486676,713 +"59",2007,2,-21.64,4.38,-8.60855590062112,644 +"60",2007,3,-20.17,22.37,0.180462833099579,713 +"61",2007,4,-7.36,23.15,5.38073913043478,690 +"62",2007,5,0.56,31.39,15.0586956521739,713 +"63",2007,6,8.19,34.67,20.8518695652174,690 +"64",2007,7,9.48,32.28,20.618667601683,713 +"65",2007,8,10.77,35.37,21.2569144460028,713 +"66",2007,9,3.03,33.51,17.5431395348837,688 +"67",2007,10,-0.64,29.22,13.3939270687237,713 +"68",2007,11,-8.32,14.85,2.20031884057971,690 +"69",2007,12,-13.72,7.12,-2.71035063113604,713 +"70",2008,1,-15.76,13.59,-2.88023842917251,713 +"71",2008,2,-19.28,6.2,-5.80101949025487,667 +"72",2008,3,-16.65,11.9,-2.42140252454418,713 +"73",2008,4,-6.09,24.84,8.97944927536232,690 +"74",2008,5,-1.18,27.5,11.4087096774194,713 +"75",2008,6,9.61,32.3,19.2780434782609,690 +"76",2008,7,10.9,31.42,21.6141093969144,713 +"77",2008,8,9.99,29.08,19.0537026647966,713 +"78",2008,9,6.87,29.91,16.4674637681159,690 +"79",2008,10,-2.92,25.19,8.42349228611501,713 +"80",2008,11,-9.72,19.39,2.50087082728592,689 +"81",2008,12,-16.3,13.56,-3.47112201963534,713 +"82",2009,1,-23.23,3.38,-8.99747545582048,713 +"83",2009,2,-27.17,9.16,-3.81180124223603,644 +"84",2009,3,-16,17.19,0.213239831697055,713 +"85",2009,4,-4.65,26.5,7.14152173913044,690 +"86",2009,5,1.07,27.15,13.3342636746143,713 +"87",2009,6,5.8,32.89,17.4682608695652,690 +"88",2009,7,10.53,28.19,18.5997054698457,713 +"89",2009,8,8.75,31.28,20.2228186968839,706 +"90",2009,9,4.06,25.29,16.0798695652174,690 +"91",2009,10,-2.23,17.94,7.94448807854137,713 +"92",2009,11,-2.58,18.1,5.61870676691729,665 +"93",2009,12,-13.83,9.69,-2.69558204768583,713 +"94",2010,1,-19.58,5.45,-5.36632538569425,713 +"95",2010,2,-15.01,3.03,-4.24383045525903,637 +"96",2010,3,-7.14,18.04,2.86051893408135,713 +"97",2010,4,-0.94,26.5,10.2003188405797,690 +"98",2010,5,0.73,31.58,15.4106591865358,713 +"99",2010,6,7.84,29.46,18.9727246376812,690 +"100",2010,7,9.75,34.53,22.9535483870968,713 +"101",2010,8,9.51,32.87,21.8226788218794,713 +"102",2010,9,6.47,30.75,15.7212700729927,685 +"103",2010,10,1.1,22.29,9.71576437587658,713 +"104",2010,11,-3.22,14.28,3.56214492753623,690 +"105",2010,12,-14.29,9.91,-4.32673699015471,711 +"106",2011,1,-23.68,10.63,-7.07938288920056,713 +"107",2011,2,-19.95,10.55,-5.41880434782609,644 +"108",2011,3,-13.51,14.07,-1.35133239831697,713 +"109",2011,4,-2.77,23.12,6.07482608695652,690 +"110",2011,5,2.71,31.63,13.8029032258065,713 +"111",2011,6,8.16,32.52,18.7321304347826,690 +"112",2011,7,10.82,36.25,24.0512535211268,710 +"113",2011,8,-9.9,31.9,19.6540813464236,713 +"114",2011,9,4.83,30.88,16.619231884058,690 +"115",2011,10,-2.74,25.83,9.76211781206171,713 +"116",2011,11,-3.44,16.86,6.08494202898551,690 +"117",2011,12,-9.08,11.71,0.0646283309957924,713 +"118",2012,1,-16.11,8.78,-2.47148667601683,713 +"119",2012,2,-12.89,8.35,-1.11934032983508,667 +"120",2012,3,-12.62,25.75,6.52490883590463,713 +"121",2012,4,-1.72,23.25,6.82811572700297,674 +"122",2012,5,4,33.73,16.6658906030856,713 +"123",2012,6,8.65,32.89,19.8872753623188,690 +"124",2012,7,13.08,35.98,23.8189060308555,713 +"125",2012,8,9.91,33.22,21.0425946704067,713 +"126",2012,9,4.14,29.99,15.7746086956522,690 +"127",2012,10,-2.31,23.17,9.42063559322034,708 +"128",2012,11,-5.83,16.92,2.62292753623188,690 +"129",2012,12,-7.65,14.53,0.383197755960729,713 +"130",2013,1,-19.04,12.97,-2.98548523206751,711 +"131",2013,2,-19.95,6.04,-5.34416149068323,644 +"132",2013,3,-10.93,13.48,-1.05074542897328,711 +"133",2013,4,-6.42,25.64,5.51615835777126,682 +"134",2013,5,1.24,29.7,14.9810238429173,713 +"135",2013,6,6.77,31.71,18.610595065312,689 +"136",2013,7,11.22,34.21,21.8149858356941,706 +"137",2013,8,9.83,29.75,20.0164936886395,713 +"138",2013,9,3.52,32.71,15.5575652173913,690 +"139",2013,10,-1.53,23.68,10.2755119214586,713 +"140",2013,11,-11.73,16.03,1.84811594202899,690 +"141",2013,12,-16.65,11.73,-4.21176211453744,681 +"142",2014,1,-24.89,6.74,-8.99959326788219,713 +"143",2014,2,-27.74,3.86,-9.21914596273292,644 +"144",2014,3,-22.74,11.68,-4.92946704067321,713 +"145",2014,4,-7.33,23.71,5.52517391304348,690 +"146",2014,5,2.82,29.05,13.9605049088359,713 +"147",2014,6,9.1,31.26,19.9623768115942,690 +"148",2014,7,10.69,30.18,19.6366619915849,713 +"149",2014,8,10.39,30.32,19.3875596072931,713 +"150",2014,9,4.65,29.24,15.8779565217391,690 +"151",2014,10,0.13,21.5,10.024081920904,708 +"152",2014,11,-11.06,15.65,1.25915942028986,690 +"153",2014,12,-9.88,9.75,-0.549200561009818,713 +"154",2015,1,-22.5,4.99,-8.00589060308555,713 +"155",2015,2,-29.83,-0.3,-12.9292391304348,644 +"156",2015,3,-22.74,9.96,-2.54772151898734,711 +"157",2015,4,-4.64,22.85,6.26617391304348,690 +"158",2015,5,0.14,30.69,16.7485834502104,713 +"159",2015,6,6.45,28.22,17.913,690 +"160",2015,7,9.02,32.84,21.2703225806452,713 +"161",2015,8,10.39,31.12,19.9525525946704,713 +"162",2015,9,7.41,32.65,18.7175801749271,686 +"163",2015,10,-2.26,21.75,9.45601706970128,703 +"164",2015,11,-7.01,22.18,6.1259738372093,688 +"165",2015,12,-6.28,14.49,3.56023943661972,710 +"166",2016,1,-16.06,9.58,-4.14040673211781,713 +"167",2016,2,-24.25,13.59,-2.65010494752624,667 +"168",2016,3,-11.04,17.91,2.32879382889201,713 +"169",2016,4,-10.58,24.01,4.59620087336245,687 +"170",2016,5,1.18,32.14,14.101096345515,602 +"171",2016,6,7.28,33.24,19.3093401015228,591 +"172",2016,7,10.77,34.45,22.8108695652174,713 +"173",2016,8,13.24,33,23.0189170182841,711 +"174",2016,9,6.34,31.82,18.1680696661829,689 +"175",2016,10,-2.58,24.22,11.2127769985975,713 +"176",2016,11,-5.72,19.95,5.70314949201742,689 +"177",2016,12,-13.88,10.31,-2.15877980364656,713 +"178",2017,1,-14.8,9.85,-2.37214586255259,713 +"179",2017,2,-11.22,15.47,-0.827360248447205,644 +"180",2017,3,-13.29,17.35,-0.778008415147265,713 +"181",2017,4,-0.75,22.48,8.60956060606061,660 +"182",2017,5,0.75,28.38,11.9987377279102,713 +"183",2017,6,8.41,31.69,19.0281739130435,690 +"184",2017,7,12.16,31.04,20.8968302945302,713 +"185",2017,8,8.65,29.38,19.2555119214586,713 +"186",2017,9,5.96,31.23,17.4505942028986,690 +"187",2017,10,0.46,25.03,12.3198732394366,710 +"188",2017,11,-10.28,15.57,2.79275362318841,690 +"189",2017,12,-24.17,10.45,-4.96740532959327,713 +"190",2018,1,-23.28,11.82,-6.54557610241821,703 +"191",2018,2,-17.86,14.26,-2.43245341614907,644 +"192",2018,3,-8.19,8.64,-1.22426367461431,713 +"193",2018,4,-6.66,18.39,2.50071014492754,690 +"194",2018,5,3.3,31.47,17.2958064516129,713 +"195",2018,6,9.13,34.96,19.3648550724638,690 +"196",2018,7,11.98,34.1,22.748793828892,713 +"197",2018,8,12.11,31.95,22.1315007012623,713 +"198",2018,9,6.02,31.23,18.0669420289855,690 +"199",2018,10,-1.1,27.2,8.52189340813464,713 +"200",2018,11,-13.7,13.51,0.883536231884058,690 +"201",2018,12,-7.89,11.57,-0.685133239831697,713 +"202",2019,1,-23.84,8.4,-7.07980364656382,713 +"203",2019,2,-21.19,11.6,-4.77998447204969,644 +"204",2019,3,-18.88,10.36,-1.90485273492286,713 +"205",2019,4,-7.57,19.92,5.57849275362319,690 +"206",2019,5,2.42,28.57,11.9953295932679,713 +"207",2019,6,5.77,30.93,18.2841605839416,685 +"208",2019,7,12.78,32.38,22.7161009817672,713 +"209",2019,8,10.5,29.56,20.4282328190743,713 +"210",2019,9,8.3,28.89,17.0988905109489,685 +"211",2019,10,-0.54,29.35,10.0050350631136,713 +"212",2019,11,-10.31,10.52,0.526072463768116,690 +"213",2019,12,-15.17,10.18,-1.16074333800842,713 +"214",2020,1,-14.07,10.9,-1.61101265822785,711 +"215",2020,2,-21.03,7.84,-3.29809595202399,667 +"216",2020,3,-13.7,18.5,2.30008415147265,713 +"217",2020,4,-3.79,16.83,5.20092753623188,690 +"218",2020,5,-2.66,32.25,12.2138709677419,713 +"219",2020,6,7.06,33.51,20.1293623188406,690 +"220",2020,7,15.47,36.52,24.2011271676301,692 +"221",2020,8,10.77,31.9,21.2907994389902,713 +"222",2020,9,1.64,28.46,16.0062898550725,690 +"223",2020,10,-5.59,23.12,8.63796633941094,713 +"224",2020,11,-4.78,22.23,5.81498550724638,690 +"225",2020,12,-8.81,8.48,-0.923239831697055,713 +"226",2021,1,-12.97,4.62,-2.84312762973352,713 +"227",2021,2,-19.31,8.83,-6.26782608695652,644 +"228",2021,3,-11.76,20.57,2.70422159887798,713 +"229",2021,4,-5.64,22.13,7.45320289855072,690 +"230",2021,5,0.83,30.88,13.2403927068724,713 +"231",2021,6,8.81,31.85,20.9899130434783,690 +"232",2021,7,13.37,31.34,20.7433826638478,473 +"233",2022,2,-15.24,8.73,-4.96495689655172,232 +"234",2022,3,-14.95,19.28,0.197954545454545,704 +"235",2022,4,-4.54,25.53,5.98973684210526,684 +"236",2022,5,2.15,31.11,15.2570554765292,703 +"237",2022,6,7.38,34.03,19.1461200585652,683 +"238",2022,7,12.13,33.45,22.0537146892655,708 +"239",2022,8,11.52,31.46,21.334,705 +"240",2022,9,3.97,30.33,16.8153801169591,684 +"241",2022,10,-0.84,23.07,9.58256011315417,707 +"242",2022,11,-7.37,23.32,4.5755604719764,678 +"243",2022,12,-16.05,10.8,-1.15888260254597,707 +"244",2023,1,-12.51,4.73,-1.2071754636234,701 +"245",2023,2,-19.81,13.6,-2.18073783359498,637 +"246",2023,3,-8.2,9.72,-0.0752247191011236,712 +"247",2023,4,-4.75,27.69,8.29420289855072,690 +"248",2023,5,0.86,30.76,13.3864838255978,711 +"249",2023,6,9.76,31.22,18.7333768115942,690 +"250",2023,7,-1.7,31.67,20.5233520336606,713 +"251",2023,8,9.64,28.01,19.0348387096774,713 +"252",2023,9,5.79,31.29,17.2479710144928,690 +"253",2023,10,-0.79,28.1,11.4988779803647,713 +"254",2023,11,-6.34,13.99,3.07294202898551,690 +"255",2023,12,-4.73,12.1,2.40245390070922,705 +"256",NA,NA,-54.99,36.17,9.84922886544223,7677 diff --git a/data/biotic_inventory_description.xlsx b/data/biotic_inventory_description.xlsx new file mode 100644 index 0000000..8d3d647 Binary files /dev/null and b/data/biotic_inventory_description.xlsx differ diff --git a/data/fish_order_family.xlsx b/data/fish_order_family.xlsx new file mode 100644 index 0000000..1504e3b Binary files /dev/null and b/data/fish_order_family.xlsx differ diff --git a/data/precipitation/CSM_precip_metadata.xlsx b/data/precipitation/CSM_precip_metadata.xlsx new file mode 100644 index 0000000..d4eb84e Binary files /dev/null and b/data/precipitation/CSM_precip_metadata.xlsx differ diff --git a/data/precipitation/CSM_raw_precip.xlsx b/data/precipitation/CSM_raw_precip.xlsx new file mode 100644 index 0000000..6665cdb Binary files /dev/null and b/data/precipitation/CSM_raw_precip.xlsx differ diff --git a/data/precipitation/CSM_summarized_precip.csv b/data/precipitation/CSM_summarized_precip.csv new file mode 100644 index 0000000..34fb552 --- /dev/null +++ b/data/precipitation/CSM_summarized_precip.csv @@ -0,0 +1,289 @@ +"","Year","Month","Minimum","Maximum","Total","Num_Samples" +"1",2000,1,0,2.8,26.2,744 +"2",2000,2,0,3.8,28,696 +"3",2000,3,0,6,47.2,744 +"4",2000,4,0,19.2,85.2,720 +"5",2000,5,0,12,116.2,744 +"6",2000,6,0,8.4,132.6,720 +"7",2000,7,0,7,61.8,744 +"8",2000,8,0,11.6,46.8,744 +"9",2000,9,0,11,91.8,720 +"10",2000,10,0,2.2,19.2,744 +"11",2000,11,0,2.6,20.8,720 +"12",2000,12,0,2.4,27.2,744 +"13",2001,1,0,2.2,13.8,744 +"14",2001,2,0,4.8,67.4,672 +"15",2001,3,0,4.2,25.4,744 +"16",2001,4,0,3.4,44.6,720 +"17",2001,5,0,7,73.6,744 +"18",2001,6,0,6,57.8,720 +"19",2001,7,0,11.6,27,744 +"20",2001,8,0,11.4,54.8,744 +"21",2001,9,0,10.8,74.2,720 +"22",2001,10,0,7.8,141.4,744 +"23",2001,11,0,8,94.2,720 +"24",2001,12,0,2,40,744 +"25",2002,1,0,2.4,24.6,744 +"26",2002,2,0,3.6,43.2,672 +"27",2002,3,0,4.4,59.2,744 +"28",2002,4,0,4.6,95.6,720 +"29",2002,5,0,12.6,85.2,744 +"30",2002,6,0,13.6,72.2,720 +"31",2002,7,0,14.2,71.4,744 +"32",2002,8,0,1.2,8.4,744 +"33",2002,9,0,16.4,72.4,720 +"34",2002,10,0,3.8,62,744 +"35",2002,11,0,10,65.2,720 +"36",2002,12,0,2.6,23.6,744 +"37",2003,1,0,3.2,10.2,744 +"38",2003,2,0,9,29.4,672 +"39",2003,3,0,3.8,43.9,744 +"40",2003,4,0,5.4,41.6,720 +"41",2003,5,0,12.6,115.6,744 +"42",2003,6,0,28.6,99.8,720 +"43",2003,7,0,4.6,41,744 +"44",2003,8,0,9.6,37,744 +"45",2003,9,0,15.2,142.2,720 +"46",2003,10,0,8.6,83.6,744 +"47",2003,11,0,6.6,149,720 +"48",2003,12,0,4,66,744 +"49",2004,1,0,3.4,10.4,744 +"50",2004,2,0,2.6,30,696 +"51",2004,3,0,6.4,94.8,744 +"52",2004,4,0,8.4,55.4,720 +"53",2004,5,0,14,120.4,744 +"54",2004,6,0,10.6,60.6,720 +"55",2004,7,0,9.8,92.8,744 +"56",2004,8,0,5,40.8,744 +"57",2004,9,0,4.8,30.6,720 +"58",2004,10,0,12,66.8,744 +"59",2004,11,0,4.2,68.2,720 +"60",2004,12,0,5.8,83,744 +"61",2005,1,0,5.8,38.2,744 +"62",2005,2,0,4.8,54,672 +"63",2005,3,0,2.2,17.8,744 +"64",2005,4,0,4.6,84.6,720 +"65",2005,5,0,4,28,744 +"66",2005,6,0,7.2,36,720 +"67",2005,7,0,30.2,154.6,744 +"68",2005,8,0,6.4,71.2,744 +"69",2005,9,0,7.8,71.8,720 +"70",2005,10,0,3.4,38.6,744 +"71",2005,11,0,11.2,114.4,720 +"72",2005,12,0,2.4,26.6,744 +"73",2006,1,0,4.4,90.8,744 +"74",2006,2,0,12,67.2,672 +"75",2006,3,0,7.6,63.6,744 +"76",2006,4,0,6.4,67.4,720 +"77",2006,5,0,9.8,100.2,744 +"78",2006,6,0,5.2,31.8,720 +"79",2006,7,0,23.4,164.6,744 +"80",2006,8,0,14,49,744 +"81",2006,9,0,24.2,149.2,720 +"82",2006,10,0,16.8,171.4,744 +"83",2006,11,0,6.8,76.4,720 +"84",2006,12,0,10.2,81.4,744 +"85",2007,1,0,4.6,51.8,744 +"86",2007,2,0,3.6,10.6,672 +"87",2007,3,0,1.2,11.2,744 +"88",2007,4,0,4.4,40.2,720 +"89",2007,5,0,7,30.2,744 +"90",2007,6,0,7.8,21.2,720 +"91",2007,7,0,14.6,40.6,744 +"92",2007,8,0,7,32.8,744 +"93",2007,9,0,4.8,32.6,720 +"94",2007,10,0,15.2,59.2,744 +"95",2007,11,0,4.2,79.6,720 +"96",2007,12,0,6.6,86,744 +"97",2008,1,0,5.8,58.6,744 +"98",2008,2,0,4.2,59.3,696 +"99",2008,3,0,3.6,59.6,744 +"100",2008,4,0,3.6,54.8,720 +"101",2008,5,0,6.2,75.6,744 +"102",2008,6,0,8.8,108.2,720 +"103",2008,7,0,25.4,106.2,744 +"104",2008,8,0,37.8,124.8,744 +"105",2008,9,0,8,111,720 +"106",2008,10,0,5.4,47.6,744 +"107",2008,11,0,4.4,80,720 +"108",2008,12,0,8.4,99.6,744 +"109",2009,1,0,1,2.8,744 +"110",2009,2,0,8.4,80.2,672 +"111",2009,3,0,7.2,68.8,744 +"112",2009,4,0,6.4,139.2,720 +"113",2009,5,0,7.8,105.4,744 +"114",2009,6,0,5.4,32,720 +"115",2009,7,0,7.8,81,744 +"116",2009,8,0,23.4,160.8,744 +"117",2009,9,0,7.6,31.4,720 +"118",2009,10,0,5,83.4,744 +"119",2009,11,0,2.6,34.6,720 +"120",2009,12,0,6.6,52.6,744 +"121",2010,1,0,2.8,21.6,744 +"122",2010,2,0,5.6,14.2,672 +"123",2010,3,0,5.8,67.4,744 +"124",2010,4,0,5,63.4,720 +"125",2010,5,0,7.4,61.1,744 +"126",2010,6,0,20,128.8,720 +"127",2010,7,0,19.6,123.4,744 +"128",2010,8,0,9.6,44.8,744 +"129",2010,9,0,9.6,99,720 +"130",2010,10,0,7.8,78.4,744 +"131",2010,11,0,6,70.2,720 +"132",2010,12,0,4.4,31,744 +"133",2011,1,0,2.4,23.2,744 +"134",2011,2,0,4.6,29.2,672 +"135",2011,3,0,3.2,89,744 +"136",2011,4,0,10.6,104.6,720 +"137",2011,5,0,11.2,118,744 +"138",2011,6,0,14,53.6,720 +"139",2011,7,0,0.4,2.6,744 +"140",2011,8,0,8.2,46.6,744 +"141",2011,9,0,7,41,720 +"142",2011,10,0,4.6,35,744 +"143",2011,11,0,5.2,29.8,720 +"144",2011,12,0,4.4,56,744 +"145",2012,1,0,3.2,53.4,744 +"146",2012,2,0,6,27.2,696 +"147",2012,3,0,5.4,51.6,744 +"148",2012,4,0,3.4,29.2,720 +"149",2012,5,0,5.8,26.3,744 +"150",2012,6,0,19.4,98.4,720 +"151",2012,7,0,13.2,60.8,744 +"152",2012,8,0,8.4,62.8,744 +"153",2012,9,0,10.6,109.6,720 +"154",2012,10,0,6.8,141.6,744 +"155",2012,11,0,2.6,15,720 +"156",2012,12,0,4.8,57.4,744 +"157",2013,1,0,8.4,90.8,744 +"158",2013,2,0,3.2,28.4,672 +"159",2013,3,0,3,29.6,744 +"160",2013,4,0,8,115.6,720 +"161",2013,5,0,13.4,64.6,744 +"162",2013,6,0,8.8,105.2,720 +"163",2013,7,0,14.4,92.6,744 +"164",2013,8,0,10.8,57.2,744 +"165",2013,9,0,17.8,108.4,720 +"166",2013,10,0,7.6,128.8,744 +"167",2013,11,0,5.4,42.4,720 +"168",2013,12,0,3.8,58.2,744 +"169",2014,1,0,0.6,2.6,744 +"170",2014,2,0,3.4,25.2,672 +"171",2014,3,0,1.4,12.6,744 +"172",2014,4,0,10.4,95.8,720 +"173",2014,5,0,12,67.2,744 +"174",2014,6,0,6.4,48.8,720 +"175",2014,7,0,13.8,120,744 +"176",2014,8,0,6,23.6,744 +"177",2014,9,0,24.8,141,720 +"178",2014,10,0,6.8,66.4,744 +"179",2014,11,0,6.8,53.4,720 +"180",2014,12,0,2.2,20.6,744 +"181",2015,1,0,3.6,17.2,744 +"182",2015,2,0,2.2,4.8,672 +"183",2015,3,0,1.4,11.8,744 +"184",2015,4,0,3.4,19.4,720 +"185",2015,5,0,16.2,56.6,744 +"186",2015,6,0,18.6,110.2,720 +"187",2015,7,0,12.2,45.8,744 +"188",2015,8,0,7.8,45.4,744 +"189",2015,9,0,15,58.8,720 +"190",2015,10,0,9.2,59.8,744 +"191",2015,11,0,4.4,33.8,720 +"192",2015,12,0,0,0,744 +"193",2016,1,0,0,0,744 +"194",2016,2,0,0.8,16.4,696 +"195",2016,3,0,19,57,744 +"196",2016,4,0,5.6,61.6,720 +"197",2016,5,0,16.6,1172.6,744 +"198",2016,6,0,5,35.8,720 +"199",2016,7,0,15,80.8,744 +"200",2016,8,0,48.6,239.4,744 +"201",2016,9,0,11.4,60.6,720 +"202",2016,10,0,3.4,52.4,744 +"203",2016,11,0,8.2,61.6,720 +"204",2016,12,0,5.6,50.4,744 +"205",2017,1,0,13.6,85.8,744 +"206",2017,2,0,3.8,12.8,672 +"207",2017,3,0,5,44.2,744 +"208",2017,4,0,3.8,119.2,720 +"209",2017,5,0,2.4,19.2,744 +"210",2017,6,0,5.6,40.6,720 +"211",2017,7,0,12.2,53,744 +"212",2017,8,0,20,85.4,744 +"213",2017,9,0,7.8,18.4,720 +"214",2017,10,0,4.6,42,744 +"215",2017,11,0,21.2,68.4,720 +"216",2017,12,0,5.8,18.2,744 +"217",2018,1,0,4.2,65.2,744 +"218",2018,2,0,6.2,69,672 +"219",2018,3,0,4.6,35.4,744 +"220",2018,4,0,6.4,116.4,720 +"221",2018,5,0,9.2,55.4,744 +"222",2018,6,0,15.8,42.4,720 +"223",2018,7,0,11.4,67.4,744 +"224",2018,8,0,27.4,166,744 +"225",2018,9,0,6.2,46.4,720 +"226",2018,10,0,7,114.4,744 +"227",2018,11,0,4.8,121,720 +"228",2018,12,0,3.8,56,744 +"229",2019,1,0,8.8,43,744 +"230",2019,2,0,5.4,58.4,672 +"231",2019,3,0,5,71.8,744 +"232",2019,4,0,5,98,720 +"233",2019,5,0,7.4,111.2,744 +"234",2019,6,0,10,76.2,720 +"235",2019,7,0,24.4,133.6,744 +"236",2019,8,0,10,60.6,744 +"237",2019,9,0,42.4,76.2,720 +"238",2019,10,0,13,139.6,597 +"239",2019,11,0,4,38.2,720 +"240",2019,12,0,3.2,59.6,744 +"241",2020,1,0,7,121.6,744 +"242",2020,2,0,5.4,39.8,685 +"243",2020,3,0,6.2,86.4,744 +"244",2020,4,0,3.2,42.2,720 +"245",2020,5,0,3,48.4,744 +"246",2020,6,0,14.8,58.6,720 +"247",2020,7,0,28,54,744 +"248",2020,8,0,13.4,67.2,744 +"249",2020,9,0,10.6,55.2,720 +"250",2020,10,0,3.8,82.2,744 +"251",2020,11,0,6.2,62.2,720 +"252",2020,12,0,4.8,70,744 +"253",2021,1,0,2.2,25.6,744 +"254",2021,2,0,6.2,28,672 +"255",2021,3,0,8,49,699 +"256",2021,4,0,5.4,61.6,720 +"257",2021,5,0,3.2,30.8,744 +"258",2021,6,0,51.2,131.6,720 +"259",2021,7,0,8.6,87.4,744 +"260",2021,8,0,22.6,82.2,744 +"261",2021,9,0,29,216.8,720 +"262",2021,10,0,13.2,123,744 +"263",2021,11,0,3,44.8,720 +"264",2021,12,0,9,67,744 +"265",2022,1,0,2.2,18.8,744 +"266",2022,2,0,6,85.2,672 +"267",2022,3,0,6.4,60,744 +"268",2022,4,0,4.6,49,720 +"269",2022,5,0,5.4,53.2,744 +"270",2022,6,0,10.6,55.2,720 +"271",2022,7,0,4.8,29,744 +"272",2022,8,0,42.8,88.6,744 +"273",2022,9,0,5.4,27.2,720 +"274",2022,10,0,15.6,49.4,744 +"275",2022,11,0,4.8,35.2,720 +"276",2022,12,0,3.4,72.2,744 +"277",2023,1,0,5.8,65.4,744 +"278",2023,2,0,9.2,49.2,672 +"279",2023,3,0,7,83.2,744 +"280",2023,4,0,7.8,82,635 +"281",2023,5,0,11,56.8,744 +"282",2023,6,0,14.8,89.4,720 +"283",2023,7,0,22.8,204.2,744 +"284",2023,8,0,17,114.4,744 +"285",2023,9,0,5.8,20.8,720 +"286",2023,10,0,9,69.2,744 +"287",2023,11,0,6.8,53,720 +"288",2023,12,0,5,75,741 diff --git a/data/species_scanned_docs.xlsx b/data/species_scanned_docs.xlsx new file mode 100644 index 0000000..b3d2b91 Binary files /dev/null and b/data/species_scanned_docs.xlsx differ diff --git a/data/water_flow/ABF_annual_flashiness.csv b/data/water_flow/ABF_annual_flashiness.csv new file mode 100644 index 0000000..c7eaf34 --- /dev/null +++ b/data/water_flow/ABF_annual_flashiness.csv @@ -0,0 +1,23 @@ +"","Year","SumAbsChanges","TotalFlow","FlashinessIndex" +"1",2002,2.66029415277778,17.1333894722222,0.155269577983435 +"2",2003,23.587658375,127.90739057971,0.184412005186678 +"3",2004,20.5129250658762,132.959540184453,0.154279452511785 +"4",2005,21.0824166666667,126.618708333333,0.166503172747313 +"5",2006,33.7277297768928,164.109084810861,0.205520186866953 +"6",2007,17.5423884044018,110.369602905252,0.158942208204386 +"7",2008,30.8805141701963,169.134101537482,0.182580058601328 +"8",2009,32.561686687437,184.295956722238,0.1766815033089 +"9",2010,20.4900461847804,103.661046503953,0.197663894739854 +"10",2011,32.0168276808237,132.272309208663,0.242052383241577 +"11",2012,16.4257446439798,93.5011312531565,0.17567428782767 +"12",2013,37.1669770315624,162.127792448513,0.229244946040733 +"13",2014,36.3490295575896,186.790445486906,0.194597906026932 +"14",2015,26.4767966564963,118.3299825642,0.223753913274949 +"15",2016,12.7943154761905,53.4404588744589,0.23941253023756 +"16",2017,39.3481177536232,171.898244851259,0.228903545743999 +"17",2018,38.2156666666667,159.077810897436,0.240232540610619 +"18",2019,34.14,139.753166666667,0.244287845594435 +"19",2020,4.27035739594524,18.1621772990278,0.235123648758446 +"20",2021,28.1247984839868,110.153417164855,0.255323885612149 +"21",2022,16.8515696468254,101.371064823926,0.166236486477629 +"22",2023,30.6164805083333,143.114542891667,0.213929904604517 diff --git a/data/water_flow/ABF_flow_metadata.xlsx b/data/water_flow/ABF_flow_metadata.xlsx new file mode 100644 index 0000000..c33fb91 Binary files /dev/null and b/data/water_flow/ABF_flow_metadata.xlsx differ diff --git a/data/water_flow/ABF_raw_flow.xlsx b/data/water_flow/ABF_raw_flow.xlsx new file mode 100644 index 0000000..a4bbfc8 Binary files /dev/null and b/data/water_flow/ABF_raw_flow.xlsx differ diff --git a/data/water_flow/ABF_summarized_flow.csv b/data/water_flow/ABF_summarized_flow.csv new file mode 100644 index 0000000..c7285eb --- /dev/null +++ b/data/water_flow/ABF_summarized_flow.csv @@ -0,0 +1,240 @@ +"","Year","Month","Minimum","Maximum","Average","Num_Samples" +"1",2002,10,0.125869,0.262037,0.166979253578732,489 +"2",2002,11,0.163842,0.622274,0.227859858333333,720 +"3",2002,12,0.14813,0.65239,0.219854047043011,744 +"4",2003,1,0.173,0.708,0.319157258064516,744 +"5",2003,2,0.341,0.474,0.403313988095238,672 +"6",2003,3,0.152,1.752,0.58264247311828,744 +"7",2003,4,0.221,1.017,0.509543810848401,719 +"8",2003,5,0.223,1.095,0.503254807692308,624 +"9",2003,6,0.122,0.562,0.225755555555556,720 +"10",2003,7,0.111,0.214,0.131694892473118,744 +"11",2003,8,0.111,0.745,0.166221774193548,744 +"12",2003,9,0.11,0.715,0.174401388888889,720 +"13",2003,10,0.154,0.556,0.260806451612903,744 +"14",2003,11,0.227,1.428,0.536794444444444,720 +"15",2003,12,0.252,0.992,0.469337365591398,744 +"16",2004,1,0.331,0.835,0.494814016172507,742 +"17",2004,2,0.176,0.51,0.237677611940299,670 +"18",2004,3,0.212,1.987,0.805529569892473,744 +"19",2004,4,0.346,1.654,0.655670375521558,719 +"20",2004,5,0.254,1.159,0.550045698924731,744 +"21",2004,6,0.137,0.478,0.231804166666667,720 +"22",2004,7,0.129,0.399,0.17809811827957,744 +"23",2004,8,0.123,0.462,0.169948924731183,744 +"24",2004,9,0.127,0.399,0.160194444444444,720 +"25",2004,10,0.123,0.293,0.171333333333333,744 +"26",2004,11,0.185,0.52,0.278161111111111,720 +"27",2004,12,0.231,1.115,0.41515188172043,744 +"28",2005,1,0.225,1.38,0.553587365591398,744 +"29",2005,2,0.185,1.582,0.444252976190476,672 +"30",2005,3,0.176,1.282,0.367251344086022,744 +"31",2005,4,0.328,1.933,0.941652777777778,720 +"32",2005,5,0.174,0.604,0.276743279569892,744 +"33",2005,6,0.121,0.494,0.181640277777778,720 +"34",2005,7,0.112,0.594,0.166737903225806,744 +"35",2005,8,0.114,0.556,0.153538978494624,744 +"36",2005,9,0.123,0.6,0.185180555555556,720 +"37",2005,10,0.154,0.31,0.19445564516129,744 +"38",2005,11,0.19,1.215,0.377665277777778,720 +"39",2005,12,0.195,0.999,0.33915188172043,744 +"40",2006,1,0.239164757984219,1.12686657473098,0.527729571770591,744 +"41",2006,2,0.209652018863812,1.38,0.622268064080842,672 +"42",2006,3,0.174112073720234,2.14,0.695302145101473,744 +"43",2006,4,0.302766213827117,1.00742364668616,0.536373252860345,720 +"44",2006,5,0.219119167781021,1.02329341112318,0.456726772729218,744 +"45",2006,6,0.135069580552281,0.290635189253258,0.185611502162494,720 +"46",2006,7,0.127347049678583,0.755784170400247,0.197862364040113,744 +"47",2006,8,0.116700042609039,0.249729920166782,0.138427865986247,744 +"48",2006,9,0.117271469248209,0.932469989308655,0.252585749496376,720 +"49",2006,10,0.262872889456415,1.4161274741172,0.610107660751814,744 +"50",2006,11,0.327986053018808,1.28222141958165,0.524131683813386,663 +"51",2006,12,0.351738868810492,2.12733319220653,0.672602187363989,744 +"52",2007,1,0.269631101966614,0.940320168740853,0.475685333216443,741 +"53",2007,2,0.188493283950525,0.562786251305149,0.257884159318789,606 +"54",2007,3,0.217195716877443,2.74684877404921,0.773159779678391,743 +"55",2007,4,0.402081028211521,1.07501428320909,0.667568996697715,549 +"56",2007,5,0.172594725554033,0.963931479193255,0.335626438721308,744 +"57",2007,6,0.127347049678583,0.297874844600998,0.179075274221499,720 +"58",2007,7,0.114376550908063,0.146924978343265,0.128106727376051,744 +"59",2007,8,0.111353016598047,0.239164757984219,0.122262133517099,744 +"60",2007,9,0.111612812898609,0.145738026248477,0.11964997110886,720 +"61",2007,10,0.115209666873303,0.545982282860434,0.161660385911383,744 +"62",2007,11,0.154398728967902,0.635498413767828,0.229401644218973,543 +"63",2007,12,0.154398728967902,0.81626098908359,0.337867422823888,744 +"64",2008,1,0.188493283950525,1.94188182833633,0.455838860415851,738 +"65",2008,2,0.223010730915429,0.692989868794132,0.35880424356762,696 +"66",2008,3,0.221057523296954,1.3014312415506,0.447381473067739,744 +"67",2008,4,0.297874844600998,2.062425703485,1.08580630033232,720 +"68",2008,5,0.198793107655272,1.40457722414615,0.455165945737443,744 +"69",2008,6,0.190170645337391,0.509760504098771,0.278530521657467,720 +"70",2008,7,0.163841986485749,1.34227215997302,0.394419389140484,744 +"71",2008,8,0.172594725554033,0.782092164086678,0.317774200074819,744 +"72",2008,9,0.161060902576527,1.32064338342367,0.347745603307664,597 +"73",2008,10,0.232997712702477,0.351738868810492,0.273469291770481,744 +"74",2008,11,0.254055079974723,1.26231242696662,0.438084555669567,720 +"75",2008,12,0.295448585678353,2.29473067382468,0.73082663252573,744 +"76",2009,1,0.300314071984949,1.11489575173059,0.436242290642141,716 +"77",2009,2,0.300314071984949,2.62836633933723,0.766425591370383,672 +"78",2009,3,0.322841792062403,1.94188182833633,0.944879698024436,744 +"79",2009,4,0.281166394337779,1.84405191761713,0.919244403578609,553 +"80",2009,5,0.300314071984949,1.88376501878642,0.683872170636798,727 +"81",2009,6,0.247588466141897,0.590091525434754,0.349895926214252,703 +"82",2009,7,0.177195788919186,0.477771986144196,0.256638942197049,663 +"83",2009,8,0.191863764049568,1.92842359602358,0.517504171338752,744 +"84",2009,9,0.195297139477963,0.425603811862503,0.248934408377603,720 +"85",2009,10,0.254055079974723,0.7445861652886,0.370674869147009,744 +"86",2009,11,0.245461168536285,0.748313548429499,0.319290595179399,697 +"87",2009,12,0.221057523296954,0.885611859626364,0.411637108249901,744 +"88",2010,1,0.169609700299535,0.529387817597751,0.259456924821378,739 +"89",2010,2,0.168142284095781,0.24334808172486,0.194133445681194,530 +"90",2010,3,0.185185967124622,3.33602449929822,0.747074460591916,744 +"91",2010,4,0.211515318099082,1.44793672370972,0.430789170468754,720 +"92",2010,5,0.134106976483471,0.660444197926237,0.261560188245056,744 +"93",2010,6,0.136042674381316,0.610894484340227,0.284111939931113,720 +"94",2010,7,0.133150941628604,1.26631909013369,0.281067533997606,525 +"95",2010,8,0.116167674597469,0.191863764049568,0.143164601044143,744 +"96",2010,9,0.121654357025093,0.7445861652886,0.188488344597626,719 +"97",2010,10,0.142298395169565,0.671235309330183,0.265118428753981,505 +"98",2010,11,0.155698885066281,0.797232473689159,0.257664242316458,720 +"99",2010,12,0.143423615709542,1.10691579391019,0.26950520044755,744 +"100",2011,1,0.123465065179814,0.621395978183972,0.188995908076481,737 +"101",2011,2,0.0928762987439845,0.443685529714576,0.136630735128609,672 +"102",2011,3,0.110830452665744,1.76285340062514,0.671297969693247,744 +"103",2011,4,0.235038929919278,1.32470088299221,0.611756548991605,671 +"104",2011,5,0.198793107655272,2.37244299292063,0.627830190663049,744 +"105",2011,6,0.116700042609039,1.15080466774054,0.366324954019534,719 +"106",2011,7,0.115209666873303,0.200564428337364,0.134605835631581,744 +"107",2011,8,0.116167674597469,0.310199586335163,0.139118286732134,743 +"108",2011,9,0.114778803368796,0.278832426898209,0.167638025377406,720 +"109",2011,10,0.119246219890873,1.90157885391625,0.347318183085248,744 +"110",2011,11,0.144570532386541,2.23324200693416,0.343142044438049,720 +"111",2011,12,0.281166394337779,1.83531472719169,0.609595327961655,744 +"112",2012,1,0.185185967124622,0.963931479193255,0.415464583212574,666 +"113",2012,2,0.202351227454468,0.850780671686719,0.36309221871742,696 +"114",2012,3,0.254055079974723,0.912892951977249,0.503010360892344,744 +"115",2012,4,0.111875101283386,0.774550697759253,0.233300915776775,719 +"116",2012,5,0.1208043770401,0.373658479355854,0.19557244596691,744 +"117",2012,6,0.121654357025093,0.443685529714576,0.178451124522834,719 +"118",2012,7,0.10872976983621,0.177195788919186,0.1170006915132,744 +"119",2012,8,0.111353016598047,0.285874314782216,0.129219510650486,743 +"120",2012,9,0.113315340828956,0.376450311193724,0.161663866527413,720 +"121",2012,10,0.128333825728216,1.35174210438738,0.325078667821074,743 +"122",2012,11,0.1570149490989,1.04714105619187,0.255859259658999,720 +"123",2012,12,0.181942081515649,0.79344035912116,0.335210669193529,480 +"124",2013,1,0.162,1.84,0.448589820359281,668 +"125",2013,2,0.184,0.905,0.293140625,512 +"126",2013,3,0.187,1.875,0.539126344086022,744 +"127",2013,4,0.444,2.383,0.953,720 +"128",2013,5,0.113,1.071,0.332377688172043,744 +"129",2013,6,0.195,0.972,0.398176634214186,719 +"130",2013,7,0.174,0.816,0.320217741935484,744 +"131",2013,8,0.117,1.051,0.215648247978437,742 +"132",2013,9,0.161,1.242,0.295065277777778,720 +"133",2013,10,0.229,1.687,0.595133064516129,744 +"134",2013,11,0.256,1.78,0.571097222222222,720 +"135",2013,12,0.243,0.996,0.446708333333333,744 +"136",2014,1,0.261,0.952,0.504387218045113,532 +"137",2014,2,0.263,0.901,0.337643178410795,667 +"138",2014,3,0.21,1.067,0.408091397849462,744 +"139",2014,4,0.176,2.358,1.20396105702364,719 +"140",2014,5,0.303,1.626,0.716228571428571,735 +"141",2014,6,0.201,0.678,0.312048678720445,719 +"142",2014,7,0.167,1.57,0.352422043010753,744 +"143",2014,8,0.171,0.905,0.307668965517241,725 +"144",2014,9,0.171,2.811,0.645388888888889,720 +"145",2014,10,0.31,1.011,0.482662180349933,743 +"146",2014,11,0.323,1.951,0.567829166666667,720 +"147",2014,12,0.288,0.801,0.444226110363392,743 +"148",2015,1,0.199,0.929,0.293252688172043,744 +"149",2015,2,0.217,1.191,0.249141779788839,663 +"150",2015,3,0.185,0.839,0.355623655913978,744 +"151",2015,4,0.206,1.937,0.762004172461752,719 +"152",2015,5,0.12,1.223,0.216209677419355,744 +"153",2015,6,0.162,1.338,0.517162726008345,719 +"154",2015,7,0.121,0.805,0.251995967741936,744 +"155",2015,8,0.132,0.932,0.229753369272237,742 +"156",2015,9,0.131,0.51,0.171227777777778,720 +"157",2015,10,0.171,1.46,0.312207267833109,743 +"158",2015,11,0.263,1.159,0.368791666666667,720 +"159",2015,12,0.229,0.828,0.416030927835052,291 +"160",2016,1,0.197,0.921,0.405300531914894,376 +"161",2016,6,0.127,0.189,0.143849710982659,346 +"162",2016,7,0.115,0.37,0.146727150537634,744 +"163",2016,8,0.114,1.678,0.288401617250674,742 +"164",2016,9,0.139,0.548,0.190013888888889,720 +"165",2016,10,0.157,0.317,0.196426075268817,744 +"166",2016,11,0.182,1.056,0.290906944444444,720 +"167",2016,12,0.178,1.474,0.33709811827957,744 +"168",2017,1,0.167,2.519,0.698342741935484,744 +"169",2017,2,0.149,1.916,0.544436011904762,672 +"170",2017,3,0.206,1.72,0.575177419354839,744 +"171",2017,4,0.366,2.224,0.866411111111111,720 +"172",2017,5,0.252,2.357,0.844701612903226,744 +"173",2017,6,0.186,1.181,0.331791666666667,720 +"174",2017,7,0.166,1.036,0.342314516129032,744 +"175",2017,8,0.161,0.405,0.228431451612903,744 +"176",2017,9,0.167,0.413,0.203611961057024,719 +"177",2017,10,0.176,0.415,0.267367706919946,737 +"178",2017,11,0.246,0.968,0.418115277777778,720 +"179",2017,12,0.248,1.021,0.335684139784946,744 +"180",2018,1,0.284,2.453,0.672271646859083,589 +"181",2018,2,0.226,3.271,1.00525765306122,392 +"182",2018,3,0.203,0.855,0.372772849462366,744 +"183",2018,4,0.336,2.142,0.9679,720 +"184",2018,5,0.167,1.099,0.45565188172043,744 +"185",2018,6,0.143,0.996,0.290013888888889,720 +"186",2018,7,0.137,0.357,0.199603494623656,744 +"187",2018,8,0.14,0.618,0.225354838709677,744 +"188",2018,9,0.149,0.275,0.178747222222222,720 +"189",2018,10,0.183,1.003,0.320254032258065,744 +"190",2018,11,0.274,1.714,0.627651388888889,720 +"191",2018,12,0.293,1.029,0.479426075268817,744 +"192",2019,1,0.143,0.976,0.326809139784946,744 +"193",2019,2,0.167,1.986,0.427572916666667,672 +"194",2019,3,0.191,2.393,0.705641129032258,744 +"195",2019,4,0.578,2.219,1.00453055555556,720 +"196",2019,5,0.244,2.064,0.896954301075269,744 +"197",2019,6,0.223,1.064,0.456427777777778,720 +"198",2019,7,0.115,0.622,0.251287634408602,744 +"199",2019,8,0.112,0.302,0.16052688172043,744 +"200",2019,9,0.124,0.302,0.158009722222222,720 +"201",2019,10,0.151,0.7,0.265312607944732,579 +"202",2020,11,0.156536076909185,0.841224074770594,0.283992101855259,595 +"203",2020,12,0.16729512522191,0.738921,0.357377786097801,744 +"204",2021,1,0.085625,0.675361,0.282422559139785,744 +"205",2021,2,0.127038,0.602452,0.173482946348733,671 +"206",2021,3,0.09557,1.492691,0.461864134408602,744 +"207",2021,4,0.189002,1.046673,0.330906995833333,720 +"208",2021,5,0.092857,0.483463,0.188867342741935,744 +"209",2021,6,0.080996,2.163964,0.192321883333333,720 +"210",2021,7,0.125669,1.6021,0.252636969086022,744 +"211",2021,8,0.074,0.259507,0.11284275,744 +"212",2021,9,0.078908,2.178827,0.373647184722222,720 +"213",2021,10,0.192454,0.83933,0.420443169354839,744 +"214",2021,11,0.078013,0.788005,0.340304282729805,718 +"215",2021,12,0.271577,1.456202,0.480494690860215,744 +"216",2022,1,0.181009,0.482515,0.242545403225806,744 +"217",2022,2,0.199823,2.000992,0.515156816964286,672 +"218",2022,3,0.33032,1.768082,0.852371844086022,744 +"219",2022,4,0.296773,0.668593,0.441289879166667,720 +"220",2022,5,0.172918,0.895464,0.290939125,744 +"221",2022,6,0.125526,0.320452,0.197638833333333,474 +"222",2022,7,0.079072,0.143215,0.104539044354839,744 +"223",2022,8,0.07625,0.33462,0.11855631671159,742 +"224",2022,9,0.07925,0.136739,0.101470820833333,720 +"225",2022,10,0.088571,0.292867,0.131129733777038,601 +"226",2022,11,0.145413,0.661494,0.177517025,720 +"227",2022,12,0.128054,0.89529,0.213430853494624,744 +"228",2023,1,0.19361,0.908145,0.337180754032258,744 +"229",2023,2,0.185305,1.201512,0.371521275297619,672 +"230",2023,3,0.171017,1.550238,0.502785994623656,744 +"231",2023,4,0.282862,2.024844,0.663908525,720 +"232",2023,5,0.155245,0.754459,0.341799786290323,744 +"233",2023,6,0.124138,0.593096,0.220664116666667,720 +"234",2023,7,0.178967,3.249679,0.68704825672043,744 +"235",2023,8,0.28143,0.873516,0.435205963709677,744 +"236",2023,9,0.177087,0.292822,0.224068861111111,720 +"237",2023,10,0.161232,0.294483,0.23511135483871,744 +"238",2023,11,0.221672,0.720124,0.304049033333333,720 +"239",2023,12,0.235279,0.857785,0.375370975675676,740 diff --git a/data/water_flow/SR10_annual_flashiness.csv b/data/water_flow/SR10_annual_flashiness.csv new file mode 100644 index 0000000..1fe50e2 --- /dev/null +++ b/data/water_flow/SR10_annual_flashiness.csv @@ -0,0 +1,26 @@ +"","Year","SumAbsChanges","TotalFlow","FlashinessIndex" +"1",1999,9.77145833333333,59.5124166666667,0.1641919263347 +"2",2000,48.6415416666667,255.909113636364,0.190073502953804 +"3",2001,39.5304204545455,251.516170454545,0.157168504844461 +"4",2002,32.0044381323355,213.703854611058,0.149760696598495 +"5",2003,42.4499780701754,237.224792585466,0.178944104482173 +"6",2004,44.9205655,317.834589458333,0.141333155640975 +"7",2005,45.7036022727273,318.502150058772,0.143495427783749 +"8",2006,74.5021086039317,374.697620829605,0.198832617188706 +"9",2007,39.5004252923006,289.120832250889,0.136622549765019 +"10",2008,77.3670327109359,441.365100608055,0.175290326771078 +"11",2009,86.0819456069211,505.101646879006,0.170424994926895 +"12",2010,51.6064166586953,284.500035090454,0.181393357797961 +"13",2011,69.5083646500348,383.633792067183,0.181184155534094 +"14",2012,33.6613250131037,239.715464921316,0.140421999991334 +"15",2013,109.415675,403.336884615385,0.2712761445171 +"16",2014,79.916,474.291367141795,0.168495582117792 +"17",2015,49.5881818181818,316.303828413012,0.156773890682829 +"18",2016,53.7857152992776,323.652005531801,0.166183784991232 +"19",2017,75.4839583333333,444.138451086957,0.169955918359689 +"20",2018,80.947625,435.595958333333,0.185831900988521 +"21",2019,80.6966213768116,504.049558865048,0.160096601529646 +"22",2020,60.6243064104424,362.55442990756,0.167214358478256 +"23",2021,49.0232615881405,234.476375223936,0.209075483793713 +"24",2022,37.0001222284592,250.323594510881,0.147809167972182 +"25",2023,63.8554702683014,348.018856265624,0.183482788701437 diff --git a/data/water_flow/SR10_flow_metadata.xlsx b/data/water_flow/SR10_flow_metadata.xlsx new file mode 100644 index 0000000..01e519c Binary files /dev/null and b/data/water_flow/SR10_flow_metadata.xlsx differ diff --git a/data/water_flow/SR10_raw_flow.xlsx b/data/water_flow/SR10_raw_flow.xlsx new file mode 100644 index 0000000..1ca45e4 Binary files /dev/null and b/data/water_flow/SR10_raw_flow.xlsx differ diff --git a/data/water_flow/SR10_summarized_flow.csv b/data/water_flow/SR10_summarized_flow.csv new file mode 100644 index 0000000..23e246a --- /dev/null +++ b/data/water_flow/SR10_summarized_flow.csv @@ -0,0 +1,294 @@ +"","Year","Month","Minimum","Maximum","Average","Num_Samples" +"1",1999,8,0.155,0.178,0.166203703703704,54 +"2",1999,9,0.137,0.997,0.255440239043825,502 +"3",1999,10,0.351,1.095,0.484923387096774,744 +"4",1999,11,0.361,2.487,0.6755875,720 +"5",1999,12,0.395,1.116,0.579942204301075,744 +"6",2000,1,0.325,0.782,0.524927419354839,744 +"7",2000,2,0.397,3.784,0.94176867816092,696 +"8",2000,3,0.487,1.116,0.661677419354839,744 +"9",2000,4,0.401,5.425,0.922427777777778,720 +"10",2000,5,0.395,3.46,1.00380241935484,744 +"11",2000,6,0.424,2.897,1.0256230876217,719 +"12",2000,7,0.341,1.14,0.559635752688172,744 +"13",2000,8,0.317,2.542,0.559522849462366,744 +"14",2000,9,0.333,0.954,0.441993036211699,718 +"15",2000,10,0.374,0.638,0.434764784946237,744 +"16",2000,11,0.359,1.086,0.594443055555556,720 +"17",2000,12,0.315,1.234,0.741452956989247,744 +"18",2001,1,0.339,0.951,0.72314247311828,744 +"19",2001,2,0.414,6.529,1.52550446428571,672 +"20",2001,3,0.454,1.98,0.96404435483871,744 +"21",2001,4,0.549,2.364,1.19595138888889,720 +"22",2001,5,0.341,1.68,0.608198924731183,744 +"23",2001,6,0.278,0.876,0.453138888888889,720 +"24",2001,7,0.171,0.296,0.233319892473118,744 +"25",2001,8,0.122,0.478,0.191043243243243,740 +"26",2001,9,0.153,0.578,0.230756944444444,720 +"27",2001,10,0.244,1.225,0.666657258064516,744 +"28",2001,11,0.422,2.392,0.6557,720 +"29",2001,12,0.43,2.535,0.895670698924731,744 +"30",2002,1,0.269,0.886,0.621748493975904,664 +"31",2002,2,0.345,1.965,0.932093357271095,557 +"32",2002,3,0.534,1.76,1.0087002688172,744 +"33",2002,4,0.638,2.795,1.30116388888889,720 +"34",2002,5,0.398,2.617,1.06935983827493,742 +"35",2002,6,0.325,0.951,0.504409722222222,720 +"36",2002,7,0.199,0.422,0.272412634408602,744 +"37",2002,8,0.158,0.3,0.200575268817204,744 +"38",2002,9,0.137,0.52,0.205718055555556,720 +"39",2002,10,0.24,0.433,0.298948087431694,732 +"40",2002,11,0.302,0.964,0.395311111111111,720 +"41",2002,12,0.201,0.647,0.393559139784946,744 +"42",2003,1,-1.584,0.608,0.377825268817204,744 +"43",2003,2,0.395,0.76,0.545304347826087,667 +"44",2003,3,0.549,3.58,1.16854582210243,742 +"45",2003,4,0.411,1.76,0.868287899860918,719 +"46",2003,5,0.411,1.9,0.826614247311828,744 +"47",2003,6,0.222,1.08,0.429777468706537,719 +"48",2003,7,0.169,0.374,0.245775537634409,744 +"49",2003,8,0.169,0.984,0.27159811827957,744 +"50",2003,9,0.169,1.313,0.33245,720 +"51",2003,10,0.361,1.156,0.571759408602151,744 +"52",2003,11,0.534,3.086,1.11459109874826,719 +"53",2003,12,0.558,2.105,1.03995698924731,744 +"54",2004,1,0.6711,1.499,0.957532123655914,744 +"55",2004,2,0.4515,1.56,1.10032083333333,696 +"56",2004,3,0.614,6.0116,1.82590819758065,744 +"57",2004,4,0.7888,3.76,1.36731569166667,720 +"58",2004,5,0.611,2.692333,1.17017661290323,744 +"59",2004,6,0.403,1.372,0.604992083333333,720 +"60",2004,7,0.3635,1.0335,0.497162634408602,744 +"61",2004,8,0.341,0.9543,0.443844489247312,744 +"62",2004,9,0.341,0.9084,0.424327638888889,720 +"63",2004,10,0.347,0.7352,0.485690456989247,744 +"64",2004,11,0.5088,1.077,0.689997430555556,720 +"65",2004,12,0.3887,1.925,0.856017741935484,744 +"66",2005,1,0.738,3.32,1.34981989247312,744 +"67",2005,2,0.578,4.302,1.3879255952381,672 +"68",2005,3,0.357,2.906,1.0709314516129,744 +"69",2005,4,0.789,5.029,2.00900981767181,713 +"70",2005,5,0.446,1.244,0.69194204851752,742 +"71",2005,6,0.309,0.854,0.427951388888889,720 +"72",2005,7,0.263,2.091,0.47339247311828,744 +"73",2005,8,0.287,0.908,0.375384408602151,744 +"74",2005,9,0.294,1,0.421320833333333,720 +"75",2005,10,0.398,1.024,0.495787634408602,744 +"76",2005,11,0.492,2.679,0.919548158640227,706 +"77",2005,12,0.414,2.241,0.912932795698925,744 +"78",2006,1,0.705,2.65816666666666,1.22970008960573,744 +"79",2006,2,0.578,2.91499999999999,1.42907941468254,672 +"80",2006,3,0.349,4.60885714285714,1.46621389849008,744 +"81",2006,4,0.6928,1.9,1.07652375,720 +"82",2006,5,0.52,2.52833333333333,0.991616353046594,744 +"83",2006,6,0.3656,0.6866,0.465233888888888,720 +"84",2006,7,0.355099999999999,1.765,0.527030480204788,744 +"85",2006,8,0.319,0.638,0.380214717741935,744 +"86",2006,9,0.335,2.52149999999999,0.688660648148148,720 +"87",2006,10,0.6928,3.7,1.44108931451613,744 +"88",2006,11,0.8168,3.014,1.14897320884593,720 +"89",2006,12,0.8668,5.38545454545454,1.48999489936264,744 +"90",2007,1,0.578,2.14566666666667,1.12416720430108,744 +"91",2007,2,0.7951,1.49,1.07317660406886,639 +"92",2007,3,0.7696,6.0116,1.77273701518965,744 +"93",2007,4,0.8199,2.1525,1.31075188174798,720 +"94",2007,5,0.4812,1.83,0.789105562817174,744 +"95",2007,6,0.341,0.8924,0.457482206995657,720 +"96",2007,7,0.285,0.3998,0.335362984020475,744 +"97",2007,8,0.2652,0.653,0.317945760269354,744 +"98",2007,9,0.2796,0.3866,0.317087125626946,718 +"99",2007,10,0.323,1.48198666666698,0.490154848839119,743 +"100",2007,11,0.4515,1.442,0.627361049438176,719 +"101",2007,12,0.4976,1.94,0.898980204950801,742 +"102",2008,1,0.5345,4.88328571428571,1.24831155491551,744 +"103",2008,2,0.668,2.17983333333333,1.26246179856115,695 +"104",2008,3,0.8106,2.6855,1.30835582437276,744 +"105",2008,4,0.7728,6.928,2.43166844914474,719 +"106",2008,5,0.506,3.184,1.03213512544803,744 +"107",2008,6,0.4948,1.544,0.716852297113292,720 +"108",2008,7,0.4137,4.44742857142857,1.04269869431644,744 +"109",2008,8,0.4704,1.785,0.799933905151404,744 +"110",2008,9,0.438,3.086,0.954480058970311,720 +"111",2008,10,0.717003333333395,1.164,0.836633103967324,744 +"112",2008,11,0.7728,3.39398777777798,1.19690729830749,720 +"113",2008,12,0.779207111111231,4.38285714285714,1.66204592316465,744 +"114",2009,1,0.4461,2.255,1.29866196236559,744 +"115",2009,2,0.6897,9.289,2.65172648321222,672 +"116",2009,3,1.16,4.851,2.18884431708018,744 +"117",2009,4,0.984,4.64114285714286,2.18631427601686,719 +"118",2009,5,0.9708,5.04471428571428,1.71636000976829,742 +"119",2009,6,0.8261,1.552,1.06356265807796,720 +"120",2009,7,0.662,2.20033333333333,0.976968997272839,743 +"121",2009,8,0.665,3.173,1.21432771685686,743 +"122",2009,9,0.5172,1.09201000000043,0.657434223789056,720 +"123",2009,10,0.6835,1.93,0.984906113719096,743 +"124",2009,11,0.3866,1.14,0.699498060549006,678 +"125",2009,12,0.435302999999956,2.1115,1.08058225793521,744 +"126",2010,1,0.374,1.52,0.785435498207885,744 +"127",2010,2,0.204,0.823,0.513709821428571,672 +"128",2010,3,0.52,9.1,1.85544393823021,744 +"129",2010,4,0.578,3.25,1.04071990740741,720 +"130",2010,5,0.374,1.6,0.642739247311833,744 +"131",2010,6,0.374,1.64,0.725930555555556,720 +"132",2010,7,0.3092,2.942,0.616922498938355,744 +"133",2010,8,0.317,0.5664,0.394066758517519,744 +"134",2010,9,0.313,1.407,0.492161283372334,710 +"135",2010,10,0.5116,1.337,0.736003607724631,743 +"136",2010,11,0.5116,1.344,0.757603981481482,720 +"137",2010,12,0.3698,2.45316666666667,0.765156935479717,743 +"138",2011,1,0.4623,1.462,0.714865786738352,744 +"139",2011,2,0.662,2.978,1.12858601190476,672 +"140",2011,3,0.4353,4.93171428571429,1.90749736943164,744 +"141",2011,4,0.8828,3.05,1.64858116203704,720 +"142",2011,5,0.705,4.01875,1.46282004928315,744 +"143",2011,6,0.4866,4.14071428571429,1.08498509259261,720 +"144",2011,7,0.345,0.638,0.444249462365591,744 +"145",2011,8,0.3593,0.8292,0.437013481173845,744 +"146",2011,9,0.4014,0.8044,0.532927916666664,720 +"147",2011,10,0.5374,3.405,0.989073476702507,744 +"148",2011,11,0.617,4.43128571428572,0.914058455687833,720 +"149",2011,12,0.801299999999982,3.82649999999777,1.35469988799281,744 +"150",2012,1,0.632,2.025,1.08306982526881,744 +"151",2012,2,0.662,1.842,0.916467528735646,696 +"152",2012,3,0.668,2.04,1.18123696236562,744 +"153",2012,4,0.3982,0.9052,0.587060859654703,720 +"154",2012,5,0.321,0.8075,0.481224663978497,744 +"155",2012,6,0.306349999999786,0.8764,0.432244288599539,720 +"156",2012,7,0.2364,0.4137,0.297068615591394,744 +"157",2012,8,0.124,0.4893,0.328923588158576,744 +"158",2012,9,-0.08,0.984,0.418670709237382,609 +"159",2012,10,0.343,2.58983333333333,0.836212601236056,744 +"160",2012,11,0.348999999999974,2.0705,0.586218402777775,720 +"161",2012,12,0.4353,1.51699999999988,0.763737989964164,744 +"162",2013,1,0.368,6.776,1.47072715053763,744 +"163",2013,2,0.454,3.592,1.09079761904762,672 +"164",2013,3,0.537,7.213,1.31774327956989,744 +"165",2013,4,0.974,7.194,2.1184375,720 +"166",2013,5,0.408,2.781,0.847237903225806,744 +"167",2013,6,0.578,8.806,1.25310138888889,720 +"168",2013,7,0.529,2.071,0.892994623655914,744 +"169",2013,8,-0.066,2.159,0.472134408602151,744 +"170",2013,9,0.264,2.87,0.607520833333333,720 +"171",2013,10,0.426,4.675,1.27759408602151,744 +"172",2013,11,0.496,4.309,1.239818359375,512 +"173",2013,12,0.45,2.519,1.02387365591398,744 +"174",2014,1,0.407,2.996,1.28994489247312,744 +"175",2014,2,1.04,2.649,1.44597023809524,672 +"176",2014,3,0.274,3.438,1.39318010752688,744 +"177",2014,4,0.672,6.606,2.77221527777778,720 +"178",2014,5,0.524,3.28,1.40628592592593,675 +"179",2014,6,0.468,1.313,0.661530555555556,720 +"180",2014,7,0.376,5.173,0.797060728744939,741 +"181",2014,8,0.508,2.431,0.824826446280992,726 +"182",2014,9,0.579,6.312,1.47876805555556,720 +"183",2014,10,0.947,2.174,1.27684677419355,744 +"184",2014,11,0.744,4.005,1.35831944444444,720 +"185",2014,12,0.788,1.656,1.04241700404858,741 +"186",2015,1,0.544,1.556,0.950245967741935,744 +"187",2015,2,0.568,1.48,1.10216517857143,672 +"188",2015,3,0.768,1.78,1.18225806451613,744 +"189",2015,4,0.784,4.276,1.71994166666667,720 +"190",2015,5,0.274,2.773,0.525668032786885,732 +"191",2015,6,0.401,2.835,1.05968340306834,717 +"192",2015,7,0.312,1.275,0.633304347826087,621 +"193",2015,8,0.296,0.764,0.522229323308271,266 +"194",2015,9,0.352,1.712,0.480116666666667,720 +"195",2015,10,0.52,2.996,0.831391129032258,744 +"196",2015,11,0.696,1.401,0.892945833333333,720 +"197",2015,12,0.58,1.768,0.818239247311828,744 +"198",2016,1,0.434,2.271,0.982689516129032,744 +"199",2016,2,0.45,2.158,1.06045545977012,696 +"200",2016,3,0.744,3.34,1.58672714486639,711 +"201",2016,4,0.928,4.924,1.89194722222222,720 +"202",2016,5,0.492,2.01,0.812856749311295,726 +"203",2016,6,0.308,0.806,0.466811320754717,689 +"204",2016,7,0.264,0.874,0.366387537993921,658 +"205",2016,8,0.254,2.996,0.64408064516129,744 +"206",2016,9,0.392,1.086,0.509604166666667,720 +"207",2016,10,0.474,0.866,0.592818548387097,744 +"208",2016,11,0.56,1.81,0.793986111111111,720 +"209",2016,12,0.664,2.755,0.987168010752688,744 +"210",2017,1,0.858,6.047,1.80143682795699,744 +"211",2017,2,0.708,3.772,1.38624404761905,672 +"212",2017,3,0.401,3.784,1.46732661290323,744 +"213",2017,4,1.118,4.941,2.02437361111111,720 +"214",2017,5,0.858,4.642,1.84871102150538,744 +"215",2017,6,0.612,2.142,0.893648611111111,720 +"216",2017,7,0.536,1.96,0.920412634408602,744 +"217",2017,8,0.528,1.728,0.746275908479139,743 +"218",2017,9,0.536,1.102,0.622186111111111,720 +"219",2017,10,0.58,1.285,0.816427419354839,744 +"220",2017,11,0.809,2.223,1.21171666666667,720 +"221",2017,12,0.652,1.35,0.87597311827957,744 +"222",2018,1,0.818,6.568,1.95930510752688,744 +"223",2018,2,0.477,8.617,2.02979613095238,672 +"224",2018,3,0.632,1.985,0.999661290322581,744 +"225",2018,4,1.081,4.193,2.22333888888889,720 +"226",2018,5,0.48,2.201,1.15112096774194,744 +"227",2018,6,0.407,2.115,0.736966666666667,720 +"228",2018,7,0.328,0.732,0.441536290322581,744 +"229",2018,8,0.364,1.256,0.631102150537634,744 +"230",2018,9,0.43,0.776,0.542930555555556,720 +"231",2018,10,0.556,1.973,0.952405913978495,744 +"232",2018,11,0.784,3.604,1.55361111111111,720 +"233",2018,12,0.821,2.101,1.18926344086021,744 +"234",2019,1,0.344,2.288,1.13545295698925,744 +"235",2019,2,0.552,4.459,1.5594880952381,672 +"236",2019,3,0.438,4.525,1.77539946018893,741 +"237",2019,4,1.652,4.259,2.46123783031989,719 +"238",2019,5,1.106,4.176,2.21795833333333,744 +"239",2019,6,0.955,2.239,1.34661111111111,720 +"240",2019,7,0.614,1.895,0.903211021505376,744 +"241",2019,8,0.504,0.989,0.644262449528937,743 +"242",2019,9,0.524,1.032,0.642206415620642,717 +"243",2019,10,0.58,3.29,1.15409005376344,744 +"244",2019,11,1,3.796,1.47920277777778,720 +"245",2019,12,0.846,2.478,1.28014401076716,743 +"246",2020,1,0.704,9.944,2.44479811324824,744 +"247",2020,2,0.807499999999999,1.85,1.27523292624522,696 +"248",2020,3,0.792,4.45882352941176,2.02664203747125,743 +"249",2020,4,0.854,2.2012,1.22176495370369,720 +"250",2020,5,0.62,1.72600000000004,0.927015557795688,744 +"251",2020,6,0.445999999999999,1.85750000000009,0.690108745644871,719 +"252",2020,7,0.308,0.937,0.424745295698924,744 +"253",2020,8,0.296,2.2012,0.596511117685224,738 +"254",2020,9,0.35,1.24854666666185,0.457536870370357,720 +"255",2020,10,0.292,1.321,0.704387048520586,743 +"256",2020,11,0.237,1.27159999999999,0.427999583333335,720 +"257",2020,12,0.18,1.82499999999999,0.673128600721546,743 +"258",2021,1,0.214,1.3816,0.533841857335129,743 +"259",2021,2,0.123999999999999,0.908447499999816,0.368639583310358,492 +"260",2021,3,0.194860000000412,2.17407916001457,0.750435224553234,737 +"261",2021,4,0.34,2.40914285714285,0.664196651215621,630 +"262",2021,5,0.20999116666667,0.924852,0.373703569331801,658 +"263",2021,6,0.158162416666769,2.27076010000006,0.378285598911622,720 +"264",2021,7,0.344,2.292325,0.613614601058852,744 +"265",2021,8,0.388486999999959,0.779490600000625,0.471025036384287,502 +"266",2021,9,0.446000000000001,3.30372958333339,0.941303192302893,720 +"267",2021,10,0.542105233333343,1.59379216425921,0.96978696671743,744 +"268",2021,11,0.580990999999848,1.30511389999987,0.750693537338872,720 +"269",2021,12,0.568157833333281,2.14927429899988,0.940604615399993,744 +"270",2022,1,0.164135901108914,1.01255218750022,0.578961822383964,744 +"271",2022,2,0.455093653326305,5.26320994318162,1.69637237305821,649 +"272",2022,3,0.266011462789296,2.4991585714287,1.53744449285894,744 +"273",2022,4,0.744,1.73815006666675,1.15524737761237,720 +"274",2022,5,0.321468000000012,2.195552,0.687056638196259,743 +"275",2022,6,0.245999999999999,1.05438456249992,0.389710616552865,720 +"276",2022,7,0.189183833333491,0.268969333333344,0.225686752696659,744 +"277",2022,8,0.174232416666595,1.39563520000048,0.266765821586667,744 +"278",2022,9,0.204578916666699,0.313374222222201,0.239322087816358,720 +"279",2022,10,-0.50657,0.719947333333102,0.350086505886706,722 +"280",2022,11,0.445506166656728,1.00880218750021,0.543308608391212,720 +"281",2022,12,0.248469250000325,2.34556400000003,0.670923456173454,744 +"282",2023,1,0.23044,2.40254199999943,1.05538764666489,721 +"283",2023,2,0.439175166666657,2.80263884523879,1.08880625958493,672 +"284",2023,3,0.589157333333376,3.29798416666756,1.38161382815781,744 +"285",2023,4,0.79708766666655,4.26112199754774,1.67423806085725,720 +"286",2023,5,0.28815488888892,1.98120687499992,0.916794641905623,744 +"287",2023,6,0.248754333333209,1.3367785999999,0.489315982050534,720 +"288",2023,7,0.40102637500005,4.39151513480415,1.33526497018218,744 +"289",2023,8,0.626763,2.16633760000021,1.01691902471053,744 +"290",2023,9,0.290385944444451,0.66802633333356,0.427831104841824,720 +"291",2023,10,0.288596277777703,0.70786,0.501658092499099,568 +"292",2023,11,0.480588000000004,1.29532369999985,0.730322289656341,710 +"293",2023,12,0.502649499999687,1.95825625000074,0.911452839368748,744 diff --git a/data/water_quality/PWQMN_Mill_Creek_Data.xlsx b/data/water_quality/PWQMN_Mill_Creek_Data.xlsx new file mode 100644 index 0000000..52c92dd Binary files /dev/null and b/data/water_quality/PWQMN_Mill_Creek_Data.xlsx differ diff --git a/data/water_quality/ammonium.csv b/data/water_quality/ammonium.csv new file mode 100644 index 0000000..4240f66 --- /dev/null +++ b/data/water_quality/ammonium.csv @@ -0,0 +1,77 @@ +"","X.1","X","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1",1,1,"2007-03-15 13:50:00",0.083,"mg/L","2007-03-14 01:50:00",1.70208564583333,0.4,-1.08092190762393,0.288097205817759,-2.48891467118554 +"2",2,2,"2007-03-27 10:00:00",0.098,"mg/L","2007-03-25 22:00:00",2.67916204166667,2,-1.00877392430751,0.313049516849971,-2.32278780031156 +"3",3,3,"2007-05-22 09:16:00",0.024,"mg/L","2007-05-20 21:16:00",12.6718645833333,0,-1.61978875828839,0.154919333848297,-3.72970144863419 +"4",4,4,"2007-06-19 08:50:00",0.02,"mg/L","2007-06-17 20:50:00",17.8052070833333,8.8,-1.69897000433602,0.14142135623731,-3.91202300542815 +"5",5,5,"2007-07-16 09:03:00",0.008,"mg/L","2007-07-14 21:03:00",16.1385427083333,0,-2.09691001300806,0.0894427190999916,-4.8283137373023 +"6",6,6,"2007-08-13 09:37:00",0.007,"mg/L","2007-08-11 21:37:00",18.0302233333333,2.8,-2.15490195998574,0.0836660026534076,-4.96184512992682 +"7",7,7,"2007-09-17 10:14:00",0.002,"mg/L","2007-09-15 22:14:00",14.2031420833333,0,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"8",8,8,"2007-10-22 09:23:00",0.002,"mg/L","2007-10-20 21:23:00",12.602100625,0,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"9",9,9,"2008-05-21 09:01:00",0.005,"mg/L","2008-05-19 21:01:00",10.4791666666666,0,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"10",10,10,"2008-06-24 09:21:00",0.003,"mg/L","2008-06-22 21:21:00",15.4875,1.8,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"11",11,11,"2008-07-21 09:26:00",0.016,"mg/L","2008-07-19 21:26:00",17.81875,31.8,-1.79588001734408,0.126491106406735,-4.13516655674236 +"12",12,12,"2008-08-12 09:15:00",0.002,"mg/L","2008-08-10 21:15:00",15.1958333333333,0,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"13",13,13,"2008-09-15 09:15:00",0.018,"mg/L","2008-09-13 21:15:00",14.7927048649647,24.6,-1.74472749489669,0.134164078649987,-4.01738352108597 +"14",14,14,"2008-10-09 08:46:00",0.002,"mg/L","2008-10-07 20:46:00",10.0437361134257,12,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"15",15,15,"2008-11-06 09:55:00",0.01,"mg/L","2008-11-04 21:55:00",7.03645949433987,0.2,-2,0.1,-4.60517018598809 +"16",16,16,"2009-03-18 09:20:00",0.009,"mg/L","2009-03-16 21:20:00",2.71458333333333,0,-2.04575749056068,0.0948683298050514,-4.71053070164592 +"17",17,17,"2009-04-06 09:40:00",0.011,"mg/L","2009-04-04 21:40:00",4.96145717977963,13.4,-1.95860731484178,0.104880884817015,-4.50986000618377 +"18",18,18,"2009-05-05 09:35:00",0.013,"mg/L","2009-05-03 21:35:00",10.5677118094093,6.4,-1.88605664769316,0.114017542509914,-4.3428059215206 +"19",19,19,"2009-06-15 10:00:00",0.009,"mg/L","2009-06-13 22:00:00",14.1437546219225,0,-2.04575749056068,0.0948683298050514,-4.71053070164592 +"20",20,20,"2009-07-14 09:40:00",0.011,"mg/L","2009-07-12 21:40:00",16.5927187384391,0,-1.95860731484178,0.104880884817015,-4.50986000618377 +"21",21,21,"2009-08-10 10:10:00",0.01,"mg/L","2009-08-08 22:10:00",16.5684181286549,29,-2,0.1,-4.60517018598809 +"22",22,22,"2009-09-14 09:00:00",0.003,"mg/L","2009-09-12 21:00:00",15.5200148148147,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"23",23,23,"2009-10-19 09:00:00",0.004,"mg/L","2009-10-17 21:00:00",7.18541203703738,0,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"24",24,24,"2009-11-23 08:55:00",0.018,"mg/L","2009-11-21 20:55:00",6.76458333333333,0,-1.74472749489669,0.134164078649987,-4.01738352108597 +"25",25,25,"2010-04-08 09:20:00",0.023,"mg/L","2010-04-06 21:20:00",9.22083333333334,30.2,-1.63827216398241,0.151657508881031,-3.77226106305299 +"26",26,26,"2010-04-19 09:15:00",0.023,"mg/L","2010-04-17 21:15:00",9.12083333333333,0.2,-1.63827216398241,0.151657508881031,-3.77226106305299 +"27",27,27,"2010-05-25 09:31:00",0.004,"mg/L","2010-05-23 21:31:00",14.8197916666666,0,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"28",28,28,"2010-06-21 09:20:00",0.009,"mg/L","2010-06-19 21:20:00",16.9104166666666,20,-2.04575749056068,0.0948683298050514,-4.71053070164592 +"29",29,29,"2010-07-19 09:20:00",0.021,"mg/L","2010-07-17 21:20:00",18.93125,6,-1.67778070526608,0.144913767461894,-3.86323284125871 +"30",30,30,"2010-08-16 09:40:00",0.02,"mg/L","2010-08-14 21:40:00",18.8843645948948,0.4,-1.69897000433602,0.14142135623731,-3.91202300542815 +"31",31,31,"2010-09-20 09:35:00",0.015,"mg/L","2010-09-18 21:35:00",13.6072997595263,0.2,-1.82390874094432,0.122474487139159,-4.19970507787993 +"32",32,32,"2010-10-26 09:40:00",0.002,"mg/L","2010-10-24 21:40:00",9.69999999999999,11.8,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"33",33,33,"2010-11-24 09:45:00",0.017,"mg/L","2010-11-22 21:45:00",6.68510638297872,10.2,-1.76955107862173,0.130384048104053,-4.07454193492592 +"34",34,34,"2011-03-11 16:25:00",0.064,"mg/L","2011-03-10 04:25:00",1.35416666666665,37.2,-1.19382002601611,0.25298221281347,-2.74887219562247 +"35",35,35,"2011-04-11 09:45:00",0.026,"mg/L","2011-04-09 21:45:00",4.83124999999999,6.2,-1.58502665202918,0.161245154965971,-3.64965874096066 +"36",36,36,"2011-05-17 09:35:00",0.029,"mg/L","2011-05-15 21:35:00",11.0458333333333,7,-1.53760200210104,0.170293863659264,-3.54045944899566 +"37",37,37,"2011-06-20 09:10:00",0.031,"mg/L","2011-06-18 21:10:00",15.8458333333333,0,-1.50863830616573,0.17606816861659,-3.47376807449699 +"38",38,38,"2011-07-18 09:40:00",0.045,"mg/L","2011-07-16 21:40:00",17.6541666666666,0,-1.34678748622466,0.212132034355964,-3.10109278921182 +"39",39,39,"2011-09-12 09:25:00",0.034,"mg/L","2011-09-10 21:25:00",15.7333333333333,0,-1.46852108295774,0.184390889145858,-3.38139475436598 +"40",40,40,"2011-11-17 10:10:00",0.021,"mg/L","2011-11-15 22:10:00",7.98541666666667,0,-1.67778070526608,0.144913767461894,-3.86323284125871 +"41",41,41,"2012-04-16 09:10:00",0.016,"mg/L","2012-04-14 21:10:00",8.08645833333318,4.6,-1.79588001734408,0.126491106406735,-4.13516655674236 +"42",42,42,"2012-05-05 09:15:00",0.019,"mg/L","2012-05-03 21:15:00",10.925,7.6,-1.72124639904717,0.137840487520902,-3.9633162998157 +"43",43,43,"2012-06-18 09:00:00",0.019,"mg/L","2012-06-16 21:00:00",17.6625,4.2,-1.72124639904717,0.137840487520902,-3.9633162998157 +"44",44,44,"2012-07-16 09:00:00",0.024,"mg/L","2012-07-14 21:00:00",19.3739583333333,0,-1.61978875828839,0.154919333848297,-3.72970144863419 +"45",45,45,"2012-08-13 09:00:00",0.022,"mg/L","2012-08-11 21:00:00",17.9444444444444,1.8,-1.65757731917779,0.148323969741913,-3.81671282562382 +"46",46,46,"2012-09-12 09:20:00",0.028,"mg/L","2012-09-10 21:20:00",15.8007740402899,0,-1.55284196865778,0.167332005306815,-3.57555076880693 +"47",47,47,"2012-10-15 09:20:00",0.016,"mg/L","2012-10-13 21:20:00",9.75624999999998,21.6,-1.79588001734408,0.126491106406735,-4.13516655674236 +"48",48,48,"2012-11-13 09:15:00",0.042,"mg/L","2012-11-11 21:15:00",7.06666666666692,8.8,-1.3767507096021,0.204939015319192,-3.17008566069877 +"49",49,49,"2013-04-18 09:10:00",0.015,"mg/L","2013-04-16 21:10:00",5.94479166666661,7.8,-1.82390874094432,0.122474487139159,-4.19970507787993 +"50",50,50,"2013-05-16 09:20:00",0.019,"mg/L","2013-05-14 21:20:00",10.95,0.4,-1.72124639904717,0.137840487520902,-3.9633162998157 +"51",51,51,"2013-06-17 09:45:00",0.03,"mg/L","2013-06-15 21:45:00",15.0499999999997,10.8,-1.52287874528034,0.173205080756888,-3.50655789731998 +"52",52,52,"2013-07-09 09:20:00",0.045,"mg/L","2013-07-07 21:20:00",17.6520833333333,0.6,-1.34678748622466,0.212132034355964,-3.10109278921182 +"53",53,53,"2013-08-13 09:30:00",0.015,"mg/L","2013-08-11 21:30:00",15.9833333333333,2,-1.82390874094432,0.122474487139159,-4.19970507787993 +"54",54,54,"2013-09-16 09:35:00",0.044,"mg/L","2013-09-14 21:35:00",14.5572916666667,1.2,-1.35654732351381,0.20976176963403,-3.12356564506388 +"55",55,55,"2013-10-22 09:30:00",0.024,"mg/L","2013-10-20 21:30:00",10.6666666666666,15.6,-1.61978875828839,0.154919333848297,-3.72970144863419 +"56",56,56,"2014-04-08 14:30:00",0.045,"mg/L","2014-04-07 02:30:00",2.46666550917913,15.4,-1.34678748622466,0.212132034355964,-3.10109278921182 +"57",57,57,"2014-05-01 11:50:00",0.023,"mg/L","2014-04-29 23:50:00",7.12291666666674,14,-1.63827216398241,0.151657508881031,-3.77226106305299 +"58",58,58,"2016-09-19 09:20:00",0.017,"mg/L","2016-09-17 21:20:00",15.9333334166667,0,-1.76955107862173,0.130384048104053,-4.07454193492592 +"59",59,59,"2016-11-28 09:30:00",0.005,"mg/L","2016-11-26 21:30:00",4.9250000000001,1.6,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"60",60,60,"2017-04-25 10:10:00",0.014,"mg/L","2017-04-23 22:10:00",9.125,14.4,-1.85387196432176,0.118321595661992,-4.26869794936688 +"61",61,61,"2017-05-15 09:30:00",0.011,"mg/L","2017-05-13 21:30:00",10.5489583333333,0,-1.95860731484178,0.104880884817015,-4.50986000618377 +"62",62,62,"2017-06-15 09:35:00",0.011,"mg/L","2017-06-13 21:35:00",16.5885416562499,0.2,-1.95860731484178,0.104880884817015,-4.50986000618377 +"63",63,63,"2017-07-24 09:50:00",0.015,"mg/L","2017-07-22 21:50:00",17.4499998020833,1,-1.82390874094432,0.122474487139159,-4.19970507787993 +"64",64,64,"2017-08-31 09:35:00",0.023,"mg/L","2017-08-29 21:35:00",15.5958333333333,0.4,-1.63827216398241,0.151657508881031,-3.77226106305299 +"65",65,65,"2017-09-20 09:40:00",0.014,"mg/L","2017-09-18 21:40:00",15.8458333541667,1,-1.85387196432176,0.118321595661992,-4.26869794936688 +"66",66,66,"2017-10-18 09:30:00",0.037,"mg/L","2017-10-16 21:30:00",11.7052083333334,0,-1.431798275933,0.192353840616713,-3.29683736633791 +"67",67,67,"2017-11-06 09:10:00",0.016,"mg/L","2017-11-04 21:10:00",8.25520833333336,0,-1.79588001734408,0.126491106406735,-4.13516655674236 +"68",68,68,"2018-04-09 09:50:00",0.02,"mg/L","2018-04-07 21:50:00",1.3,0,-1.69897000433602,0.14142135623731,-3.91202300542815 +"69",69,69,"2018-05-14 09:40:00",0.01,"mg/L","2018-05-12 21:40:00",10.8875,0,-2,0.1,-4.60517018598809 +"70",70,70,"2018-06-19 09:40:00",0.02,"mg/L","2018-06-17 21:40:00",16.5937497916667,3.2,-1.69897000433602,0.14142135623731,-3.91202300542815 +"71",71,71,"2018-07-23 08:45:00",0,"mg/L","2018-07-21 20:45:00",17.6875,13.6,0,0,0 +"72",72,72,"2018-08-27 09:15:00",0.01,"mg/L","2018-08-25 21:15:00",17.597916375,16,-2,0.1,-4.60517018598809 +"73",73,73,"2018-09-10 10:10:00",0.01,"mg/L","2018-09-08 22:10:00",16.3145835208333,17,-2,0.1,-4.60517018598809 +"74",74,74,"2018-10-22 09:30:00",0.01,"mg/L","2018-10-20 21:30:00",8.65697569444405,0,-2,0.1,-4.60517018598809 +"75",75,75,"2018-11-27 09:25:00",0,"mg/L","2018-11-25 21:25:00",2.59166666666667,44.8,0,0,0 +"76",76,76,"2019-04-10 09:25:00",0.02,"mg/L","2019-04-08 21:25:00",3.725,0,-1.69897000433602,0.14142135623731,-3.91202300542815 diff --git a/data/water_quality/chloride.csv b/data/water_quality/chloride.csv new file mode 100644 index 0000000..5691546 --- /dev/null +++ b/data/water_quality/chloride.csv @@ -0,0 +1,86 @@ +"","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1","2007-03-15 13:50:00",45.6,"mg/L","2007-03-14 01:50:00",1.70208564583333,0.4,1.65896484266444,6.75277720645365,3.81990771652034 +"2","2007-03-27 10:00:00",33.7,"mg/L","2007-03-25 22:00:00",2.67916204166667,2,1.52762990087134,5.80517010948,3.51749783735832 +"3","2007-05-22 09:16:00",46.6,"mg/L","2007-05-20 21:16:00",12.6718645833333,0,1.66838591669,6.8264192663504,3.8416005411316 +"4","2007-06-19 08:50:00",53,"mg/L","2007-06-17 20:50:00",17.8052070833333,8.8,1.72427586960079,7.28010988928052,3.97029191355212 +"5","2007-07-16 09:03:00",54.5,"mg/L","2007-07-14 21:03:00",16.1385427083333,0,1.73639650227664,7.3824115301167,3.9982007016692 +"6","2007-08-13 09:37:00",52.8,"mg/L","2007-08-11 21:37:00",18.0302233333333,2.8,1.72263392253381,7.26636084983398,3.96651119071222 +"7","2007-09-17 10:14:00",53.7,"mg/L","2007-09-15 22:14:00",14.2031420833333,0,1.72997428569956,7.3280283842245,3.98341300151482 +"8","2007-10-22 09:23:00",55.7,"mg/L","2007-10-20 21:23:00",12.602100625,0,1.74585519517373,7.46324326281812,4.01998014693324 +"9","2008-05-21 09:01:00",50.2,"mg/L","2008-05-19 21:01:00",10.4791666666666,0,1.70070371714502,7.08519583356734,3.91601502669768 +"10","2008-06-24 09:21:00",56,"mg/L","2008-06-22 21:21:00",15.4875,1.8,1.7481880270062,7.48331477354788,4.02535169073515 +"11","2008-07-21 09:26:00",52.6,"mg/L","2008-07-19 21:26:00",17.81875,31.8,1.72098574415374,7.2525857457875,3.96271611974366 +"12","2008-08-12 09:15:00",45.6,"mg/L","2008-08-10 21:15:00",15.1958333333333,0,1.65896484266444,6.75277720645365,3.81990771652034 +"13","2008-09-15 09:15:00",42.6,"mg/L","2008-09-13 21:15:00",14.7927048649647,24.6,1.62940959910272,6.52686754883229,3.75185425327532 +"14","2008-10-09 08:46:00",54.2,"mg/L","2008-10-07 20:46:00",10.0437361134257,12,1.73399928653839,7.36206492772238,3.9926809084456 +"15","2008-11-06 09:55:00",53.3,"mg/L","2008-11-04 21:55:00",7.03645949433987,0.2,1.72672720902657,7.30068489937759,3.9759363311718 +"16","2009-03-18 09:20:00",42.6,"mg/L","2009-03-16 21:20:00",2.71458333333333,0,1.62940959910272,6.52686754883229,3.75185425327532 +"17","2009-04-06 09:40:00",38.9,"mg/L","2009-04-04 21:40:00",4.96145717977963,13.4,1.58994960132571,6.23698645180507,3.6609942506244 +"18","2009-05-05 09:35:00",44.6,"mg/L","2009-05-03 21:35:00",10.5677118094093,6.4,1.64933485871214,6.6783231428256,3.79773385902602 +"19","2009-06-15 10:00:00",49.6,"mg/L","2009-06-13 22:00:00",14.1437546219225,0,1.6954816764902,7.0427267446636,3.90399083373088 +"20","2009-07-14 09:40:00",53.1,"mg/L","2009-07-12 21:40:00",16.5927187384391,0,1.72509452108147,7.28697468089467,3.97217692824789 +"21","2009-08-10 10:10:00",43.3,"mg/L","2009-08-08 22:10:00",16.5684181286549,29,1.63648789635337,6.58027355054484,3.76815263500844 +"22","2009-09-14 09:00:00",53.7,"mg/L","2009-09-12 21:00:00",15.5200148148147,0,1.72997428569956,7.3280283842245,3.98341300151482 +"23","2009-10-19 09:00:00",53.2,"mg/L","2009-10-17 21:00:00",7.18541203703738,0,1.72591163229505,7.29383301152419,3.9740583963476 +"24","2009-11-23 08:55:00",52,"mg/L","2009-11-21 20:55:00",6.76458333333333,0,1.7160033436348,7.21110255092798,3.95124371858143 +"25","2010-04-08 09:20:00",45,"mg/L","2010-04-06 21:20:00",9.22083333333334,30.2,1.65321251377534,6.70820393249937,3.80666248977032 +"26","2010-04-19 09:15:00",48.8,"mg/L","2010-04-17 21:15:00",9.12083333333333,0.2,1.68841982200271,6.98569967862919,3.8877303128591 +"27","2010-05-25 09:31:00",50.8,"mg/L","2010-05-23 21:31:00",14.8197916666666,0,1.70586371228392,7.12741187248218,3.92789635458444 +"28","2010-06-21 09:20:00",50.8,"mg/L","2010-06-19 21:20:00",16.9104166666666,20,1.70586371228392,7.12741187248218,3.92789635458444 +"29","2010-07-19 09:20:00",51.7,"mg/L","2010-07-17 21:20:00",18.93125,6,1.71349054309394,7.19027120489902,3.94545778151438 +"30","2010-08-16 09:40:00",53.2,"mg/L","2010-08-14 21:40:00",18.8843645948948,0.4,1.72591163229505,7.29383301152419,3.9740583963476 +"31","2010-09-20 09:35:00",54.6,"mg/L","2010-09-18 21:35:00",13.6072997595263,0.2,1.73719264270474,7.38918128076447,4.00003388275086 +"32","2010-10-26 09:40:00",51.8,"mg/L","2010-10-24 21:40:00",9.69999999999999,11.8,1.71432975974523,7.19722168617863,3.94739014926544 +"33","2010-11-24 09:45:00",51.3,"mg/L","2010-11-22 21:45:00",6.68510638297872,10.2,1.71011736511182,7.16240183178799,3.93769075217672 +"34","2011-03-11 16:25:00",45.3,"mg/L","2011-03-10 04:25:00",1.35416666666665,37.2,1.65609820201283,6.73052746818554,3.81330703248899 +"35","2011-04-11 09:45:00",43.8,"mg/L","2011-04-09 21:45:00",4.83124999999999,6.2,1.6414741105041,6.61815684310972,3.7796338173824 +"36","2011-05-17 09:35:00",46.1,"mg/L","2011-05-15 21:35:00",11.0458333333333,7,1.66370092538965,6.78969807870718,3.8308129500026 +"37","2011-06-20 09:10:00",52.4,"mg/L","2011-06-18 21:10:00",15.8458333333333,0,1.71933128698373,7.23878442834154,3.958906591327 +"38","2011-07-18 09:40:00",55.5,"mg/L","2011-07-16 21:40:00",17.6541666666666,0,1.74429298312268,7.44983221287567,4.01638302075239 +"39","2011-08-15 09:20:00",54.9,"mg/L","2011-08-13 21:20:00",17.3020833333332,0,1.73957234445009,7.40945342113708,4.00551334851548 +"40","2011-09-12 09:25:00",47.9,"mg/L","2011-09-10 21:25:00",15.7333333333333,0,1.68033551341456,6.92098258919931,3.86911550441687 +"41","2011-10-18 09:35:00",54.5,"mg/L","2011-10-16 21:35:00",11.6895833333333,0,1.73639650227664,7.3824115301167,3.9982007016692 +"42","2011-11-17 10:10:00",53.1,"mg/L","2011-11-15 22:10:00",7.98541666666667,0,1.72509452108147,7.28697468089467,3.97217692824789 +"43","2012-04-16 09:10:00",56.9,"mg/L","2012-04-14 21:10:00",8.08645833333318,4.6,1.75511226639507,7.54320886625844,4.04129534113228 +"44","2012-05-05 09:15:00",54,"mg/L","2012-05-03 21:15:00",10.925,7.6,1.73239375982297,7.34846922834953,3.98898404656427 +"45","2012-06-18 09:00:00",53.6,"mg/L","2012-06-16 21:00:00",17.6625,4.2,1.72916478969277,7.32120208708925,3.98154906807676 +"46","2012-07-16 09:00:00",55.4,"mg/L","2012-07-14 21:00:00",19.3739583333333,0,1.74350976472843,7.44311762637136,4.01457959375324 +"47","2012-08-13 09:00:00",60.4,"mg/L","2012-08-11 21:00:00",17.9444444444444,1.8,1.78103693862113,7.77174369109018,4.10098910494077 +"48","2012-09-12 09:20:00",57.1,"mg/L","2012-09-10 21:20:00",15.8007740402899,0,1.75663610824585,7.55645419492503,4.04480411666196 +"49","2012-10-15 09:20:00",63.8,"mg/L","2012-10-13 21:20:00",9.75624999999998,21.6,1.80482067872116,7.98749021908634,4.15575319035074 +"50","2012-11-13 09:15:00",55.4,"mg/L","2012-11-11 21:15:00",7.06666666666692,8.8,1.74350976472843,7.44311762637136,4.01457959375324 +"51","2013-04-18 09:10:00",40.7,"mg/L","2013-04-16 21:10:00",5.94479166666661,7.8,1.60959440922522,6.37965516309463,3.70622809244855 +"52","2013-05-16 09:20:00",50.5,"mg/L","2013-05-14 21:20:00",10.95,0.4,1.70329137811866,7.10633520177595,3.92197333628131 +"53","2013-06-17 09:45:00",51.6,"mg/L","2013-06-15 21:45:00",15.0499999999997,10.8,1.71264970162721,7.18331399842719,3.94352167248752 +"54","2013-07-09 09:20:00",42.1,"mg/L","2013-07-07 21:20:00",17.6520833333333,0.6,1.62428209583567,6.48845127900333,3.74004774068834 +"55","2013-08-13 09:30:00",53.6,"mg/L","2013-08-11 21:30:00",15.9833333333333,2,1.72916478969277,7.32120208708925,3.98154906807676 +"56","2013-09-16 09:35:00",53.8,"mg/L","2013-09-14 21:35:00",14.5572916666667,1.2,1.73078227566639,7.3348483283569,3.98527346716774 +"57","2013-10-22 09:30:00",44.8,"mg/L","2013-10-20 21:30:00",10.6666666666666,15.6,1.65127801399814,6.6932802122726,3.80220813942094 +"58","2014-04-08 14:30:00",43.8,"mg/L","2014-04-07 02:30:00",2.46666550917913,15.4,1.6414741105041,6.61815684310972,3.7796338173824 +"59","2014-05-01 11:50:00",46.1,"mg/L","2014-04-29 23:50:00",7.12291666666674,14,1.66370092538965,6.78969807870718,3.8308129500026 +"60","2014-05-12 09:40:00",53.3,"mg/L","2014-05-10 21:40:00",12.2749999999999,0,1.72672720902657,7.30068489937759,3.9759363311718 +"61","2016-09-19 09:20:00",64.6,"mg/L","2016-09-17 21:20:00",15.9333334166667,0,1.81023251799508,8.03741251896405,4.16821441078856 +"62","2016-11-28 09:30:00",67.1,"mg/L","2016-11-26 21:30:00",4.9250000000001,1.6,1.82672252016899,8.19145896650896,4.20618404397764 +"63","2017-04-25 10:10:00",56.3,"mg/L","2017-04-23 22:10:00",9.125,14.4,1.75050839485135,7.50333259292163,4.03069453514564 +"64","2017-05-15 09:30:00",54.4,"mg/L","2017-05-13 21:30:00",10.5489583333333,0,1.73559889969818,7.37563556583431,3.9963641538619 +"65","2017-06-15 09:35:00",65.5,"mg/L","2017-06-13 21:35:00",16.5885416562499,0.2,1.81624129999178,8.09320702811932,4.18205014264121 +"66","2017-07-24 09:50:00",64,"mg/L","2017-07-22 21:50:00",17.4499998020833,1,1.80617997398389,8,4.15888308335967 +"67","2017-08-31 09:35:00",65.4,"mg/L","2017-08-29 21:35:00",15.5958333333333,0.4,1.81557774832427,8.08702664766229,4.18052225846315 +"68","2017-09-20 09:40:00",66.2,"mg/L","2017-09-18 21:40:00",15.8458333541667,1,1.8208579894397,8.1363382427232,4.19268046294296 +"69","2017-10-18 09:30:00",63.5,"mg/L","2017-10-16 21:30:00",11.7052083333334,0,1.80277372529198,7.96868872525461,4.15103990589865 +"70","2017-11-06 09:10:00",68.5,"mg/L","2017-11-04 21:10:00",8.25520833333336,0,1.83569057149243,8.27647267862342,4.22683374526818 +"71","2018-04-09 09:50:00",61.1,"mg/L","2018-04-07 21:50:00",1.3,0,1.78604121024255,7.81664889834512,4.11251186617755 +"72","2018-05-14 09:40:00",64,"mg/L","2018-05-12 21:40:00",10.8875,0,1.80617997398389,8,4.15888308335967 +"73","2018-06-19 09:40:00",64.9,"mg/L","2018-06-17 21:40:00",16.5937497916667,3.2,1.81224469680037,8.05605362444913,4.17284762371004 +"74","2018-07-23 08:45:00",64.8,"mg/L","2018-07-21 20:45:00",17.6875,13.6,1.81157500587059,8.04984471899924,4.17130560335823 +"75","2018-08-27 09:15:00",69.6,"mg/L","2018-08-25 21:15:00",17.597916375,16,1.84260923961056,8.34266144584568,4.24276456734037 +"76","2018-09-10 10:10:00",64.2,"mg/L","2018-09-08 22:10:00",16.3145835208333,17,1.80753502806885,8.01249024960405,4.16200321069592 +"77","2018-10-22 09:30:00",63.5,"mg/L","2018-10-20 21:30:00",8.65697569444405,0,1.80277372529198,7.96868872525461,4.15103990589865 +"78","2018-11-27 09:25:00",68.9,"mg/L","2018-11-25 21:25:00",2.59166666666667,44.8,1.83821922190763,8.30060238777885,4.23265617801961 +"79","2019-04-10 09:25:00",52.7,"mg/L","2019-04-08 21:25:00",3.725,0,1.72181061521255,7.25947656515261,3.96461545554732 +"80","2022-06-06 09:30:00",74.2,"mg/L","2022-06-04 21:30:00",14.1879918810758,4.2,1.87040390527903,8.61394218694321,4.30676415017333 +"81","2022-07-04 08:50:00",73.5,"mg/L","2022-07-02 20:50:00",17.856007265624,0,1.8662873390842,8.57321409974112,4.29728540621879 +"82","2022-08-03 09:15:00",71.4,"mg/L","2022-08-01 21:15:00",18.6120949843758,7.4,1.85369821177617,8.44985206971104,4.26829786934554 +"83","2022-09-14 09:45:00",72,"mg/L","2022-09-12 21:45:00",15.1501078706574,0.8,1.85733249643127,8.48528137423857,4.27666611901606 +"84","2022-10-04 09:45:00",73.8,"mg/L","2022-10-02 21:45:00",8.93650900347281,0,1.86805636182304,8.59069263796581,4.30135873160643 +"85","2022-11-07 09:30:00",76,"mg/L","2022-11-05 21:30:00",11.0288683263892,2.6,1.88081359228079,8.71779788708135,4.33073334028633 diff --git a/data/water_quality/conductivity.csv b/data/water_quality/conductivity.csv new file mode 100644 index 0000000..1dfbac0 --- /dev/null +++ b/data/water_quality/conductivity.csv @@ -0,0 +1,86 @@ +"","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1","2007-03-15 13:50:00",564,"µS/cm","2007-03-14 01:50:00",1.70208564583333,0.4,2.75127910398334,23.7486841740758,6.33505425149806 +"2","2007-03-27 10:00:00",423,"µS/cm","2007-03-25 22:00:00",2.67916204166667,2,2.62634036737504,20.5669638012031,6.04737217904628 +"3","2007-05-22 09:16:00",646,"µS/cm","2007-05-20 21:16:00",12.6718645833333,0,2.81023251799508,25.4165300542777,6.4707995037826 +"4","2007-06-19 08:50:00",686,"µS/cm","2007-06-17 20:50:00",17.8052070833333,8.8,2.83632411570675,26.1916017074176,6.53087762772588 +"5","2007-07-16 09:03:00",695,"µS/cm","2007-07-14 21:03:00",16.1385427083333,0,2.84198480459011,26.3628526529281,6.54391184556479 +"6","2007-08-13 09:37:00",682,"µS/cm","2007-08-11 21:37:00",18.0302233333333,2.8,2.83378437465648,26.1151297144012,6.52502965784346 +"7","2007-09-17 10:14:00",689,"µS/cm","2007-09-15 22:14:00",14.2031420833333,0,2.83821922190763,26.2488094968134,6.53524127101366 +"8","2007-10-22 09:23:00",698,"µS/cm","2007-10-20 21:23:00",12.602100625,0,2.84385542262316,26.4196896272458,6.54821910276237 +"9","2008-05-21 09:01:00",640,"µS/cm","2008-05-19 21:01:00",10.4791666666666,0,2.80617997398389,25.298221281347,6.46146817635372 +"10","2008-06-24 09:21:00",661,"µS/cm","2008-06-22 21:21:00",15.4875,1.8,2.82020145948564,25.7099202643649,6.49375383985169 +"11","2008-07-21 09:26:00",624,"µS/cm","2008-07-19 21:26:00",17.81875,31.8,2.79518458968242,24.9799919935936,6.43615036836943 +"12","2008-08-12 09:15:00",651,"µS/cm","2008-08-10 21:15:00",15.1958333333333,0,2.81358098856819,25.5147016443461,6.47850964220857 +"13","2008-09-15 09:15:00",593,"µS/cm","2008-09-13 21:15:00",14.7927048649647,24.6,2.77305469336426,24.3515913237718,6.38519439899773 +"14","2008-10-09 08:46:00",684,"µS/cm","2008-10-07 20:46:00",10.0437361134257,12,2.83505610172012,26.153393661244,6.52795791762255 +"15","2008-11-06 09:55:00",698,"µS/cm","2008-11-04 21:55:00",7.03645949433987,0.2,2.84385542262316,26.4196896272458,6.54821910276237 +"16","2009-03-18 09:20:00",579,"µS/cm","2009-03-16 21:20:00",2.71458333333333,0,2.76267856372744,24.0624188310319,6.361302477573 +"17","2009-04-06 09:40:00",525,"µS/cm","2009-04-04 21:40:00",4.96145717977963,13.4,2.72015930340596,22.9128784747792,6.26339826259162 +"18","2009-05-05 09:35:00",605,"µS/cm","2009-05-03 21:35:00",10.5677118094093,6.4,2.78175537465247,24.5967477524977,6.40522845803084 +"19","2009-06-15 10:00:00",659,"µS/cm","2009-06-13 22:00:00",14.1437546219225,0,2.81888541459401,25.6709953059869,6.49072353450251 +"20","2009-07-14 09:40:00",666,"µS/cm","2009-07-12 21:40:00",16.5927187384391,0,2.8234742291703,25.8069758011279,6.50128967054039 +"21","2009-09-14 09:00:00",694,"µS/cm","2009-09-12 21:00:00",15.5200148148147,0,2.84135947045485,26.343879744639,6.5424719605068 +"22","2009-10-19 09:00:00",687,"µS/cm","2009-10-17 21:00:00",7.18541203703738,0,2.83695673705955,26.2106848441623,6.53233429222235 +"23","2009-11-23 08:55:00",687,"µS/cm","2009-11-21 20:55:00",6.76458333333333,0,2.83695673705955,26.2106848441623,6.53233429222235 +"24","2010-04-08 09:20:00",553,"µS/cm","2010-04-06 21:20:00",9.22083333333334,30.2,2.7427251313047,23.5159520326097,6.31535800152233 +"25","2010-04-19 09:15:00",644,"µS/cm","2010-04-17 21:15:00",9.12083333333333,0.2,2.80888586735981,25.377155080899,6.46769872610435 +"26","2010-05-25 09:31:00",665,"µS/cm","2010-05-23 21:31:00",14.8197916666666,0,2.8228216453031,25.7875939164553,6.49978704065585 +"27","2010-06-21 09:20:00",668,"µS/cm","2010-06-19 21:20:00",16.9104166666666,20,2.82477646247555,25.8456959666402,6.50428817353665 +"28","2010-07-19 09:20:00",669,"µS/cm","2010-07-17 21:20:00",18.93125,6,2.82542611776782,25.8650343127551,6.50578406012823 +"29","2010-08-16 09:40:00",692,"µS/cm","2010-08-14 21:40:00",18.8843645948948,0.4,2.84010609445676,26.3058928759318,6.53958595561767 +"30","2010-09-20 09:35:00",685,"µS/cm","2010-09-18 21:35:00",13.6072997595263,0.2,2.83569057149243,26.1725046566048,6.52941883826223 +"31","2010-10-26 09:40:00",692,"µS/cm","2010-10-24 21:40:00",9.69999999999999,11.8,2.84010609445676,26.3058928759318,6.53958595561767 +"32","2010-11-24 09:45:00",668,"µS/cm","2010-11-22 21:45:00",6.68510638297872,10.2,2.82477646247555,25.8456959666402,6.50428817353665 +"33","2011-03-11 16:25:00",471,"µS/cm","2011-03-10 04:25:00",1.35416666666665,37.2,2.6730209071289,21.7025344142107,6.15485809401642 +"34","2011-04-11 09:45:00",589,"µS/cm","2011-04-09 21:45:00",4.83124999999999,6.2,2.7701152947871,24.2693221990232,6.37842618365159 +"35","2011-05-17 09:35:00",598,"µS/cm","2011-05-15 21:35:00",11.0458333333333,7,2.77670118398841,24.454038521275,6.39359075395063 +"36","2011-06-20 09:10:00",688,"µS/cm","2011-06-18 21:10:00",15.8458333333333,0,2.83758843823551,26.229754097208,6.53378883793334 +"37","2011-07-18 09:40:00",705,"µS/cm","2011-07-16 21:40:00",17.6541666666666,0,2.8481891169914,26.5518360947035,6.55819780281227 +"38","2011-08-15 09:20:00",700,"µS/cm","2011-08-13 21:20:00",17.3020833333332,0,2.84509804001426,26.4575131106459,6.5510803350434 +"39","2011-09-12 09:25:00",661,"µS/cm","2011-09-10 21:25:00",15.7333333333333,0,2.82020145948564,25.7099202643649,6.49375383985169 +"40","2011-10-18 09:35:00",698,"µS/cm","2011-10-16 21:35:00",11.6895833333333,0,2.84385542262316,26.4196896272458,6.54821910276237 +"41","2011-11-17 10:10:00",703,"µS/cm","2011-11-15 22:10:00",7.98541666666667,0,2.84695532501982,26.5141471671257,6.55535689181067 +"42","2012-04-16 09:10:00",689,"µS/cm","2012-04-14 21:10:00",8.08645833333318,4.6,2.83821922190763,26.2488094968134,6.53524127101366 +"43","2012-05-05 09:15:00",688,"µS/cm","2012-05-03 21:15:00",10.925,7.6,2.83758843823551,26.229754097208,6.53378883793334 +"44","2012-06-18 09:00:00",685,"µS/cm","2012-06-16 21:00:00",17.6625,4.2,2.83569057149243,26.1725046566048,6.52941883826223 +"45","2012-07-16 09:00:00",698,"µS/cm","2012-07-14 21:00:00",19.3739583333333,0,2.84385542262316,26.4196896272458,6.54821910276237 +"46","2012-08-13 09:00:00",720,"µS/cm","2012-08-11 21:00:00",17.9444444444444,1.8,2.85733249643127,26.8328157299975,6.5792512120101 +"47","2012-09-12 09:20:00",694,"µS/cm","2012-09-10 21:20:00",15.8007740402899,0,2.84135947045485,26.343879744639,6.5424719605068 +"48","2012-10-15 09:20:00",701,"µS/cm","2012-10-13 21:20:00",9.75624999999998,21.6,2.84571801796666,26.4764045897475,6.55250788703459 +"49","2012-11-13 09:15:00",688,"µS/cm","2012-11-11 21:15:00",7.06666666666692,8.8,2.83758843823551,26.229754097208,6.53378883793334 +"50","2013-04-18 09:10:00",358,"µS/cm","2013-04-16 21:10:00",5.94479166666661,7.8,2.55388302664387,18.9208879284245,5.8805329864007 +"51","2013-05-16 09:20:00",643,"µS/cm","2013-05-14 21:20:00",10.95,0.4,2.80821097292422,25.3574446662119,6.46614472423762 +"52","2013-06-17 09:45:00",662,"µS/cm","2013-06-15 21:45:00",15.0499999999997,10.8,2.8208579894397,25.7293606605372,6.49526555593701 +"53","2013-07-09 09:20:00",636,"µS/cm","2013-07-07 21:20:00",17.6520833333333,0.6,2.80345711564841,25.219040425837,6.45519856334012 +"54","2013-07-09 09:20:00",636,"µS/cm","2013-07-07 21:20:00",17.6520833333333,0.6,2.80345711564841,25.219040425837,6.45519856334012 +"55","2013-08-13 09:30:00",701,"µS/cm","2013-08-11 21:30:00",15.9833333333333,2,2.84571801796666,26.4764045897475,6.55250788703459 +"56","2013-09-16 09:35:00",692,"µS/cm","2013-09-14 21:35:00",14.5572916666667,1.2,2.84010609445676,26.3058928759318,6.53958595561767 +"57","2013-10-22 09:30:00",641,"µS/cm","2013-10-20 21:30:00",10.6666666666666,15.6,2.80685802951882,25.3179778023443,6.46302945692067 +"58","2014-04-08 14:30:00",526,"µS/cm","2014-04-07 02:30:00",2.46666550917913,15.4,2.72098574415374,22.9346898823594,6.26530121273771 +"59","2014-05-01 11:50:00",563,"µS/cm","2014-04-29 23:50:00",7.12291666666674,14,2.75050839485135,23.7276210354093,6.33327962813969 +"60","2014-05-12 09:40:00",648,"µS/cm","2014-05-10 21:40:00",12.2749999999999,0,2.81157500587059,25.4558441227157,6.47389069635227 +"61","2016-09-19 09:20:00",749,"µS/cm","2016-09-17 21:20:00",15.9333334166667,0,2.87448181769947,27.367864366808,6.61873898351722 +"62","2016-11-28 09:30:00",753,"µS/cm","2016-11-26 21:30:00",4.9250000000001,1.6,2.8767949762007,27.4408454680245,6.62406522779989 +"63","2017-04-25 10:10:00",625,"µS/cm","2017-04-23 22:10:00",9.125,14.4,2.79588001734408,25,6.4377516497364 +"64","2017-05-15 09:30:00",669,"µS/cm","2017-05-13 21:30:00",10.5489583333333,0,2.82542611776782,25.8650343127551,6.50578406012823 +"65","2017-06-15 09:35:00",727,"µS/cm","2017-06-13 21:35:00",16.5885416562499,0.2,2.86153441085904,26.9629375254255,6.58892647753352 +"66","2017-07-24 09:50:00",727,"µS/cm","2017-07-22 21:50:00",17.4499998020833,1,2.86153441085904,26.9629375254255,6.58892647753352 +"67","2017-08-31 09:35:00",721,"µS/cm","2017-08-29 21:35:00",15.5958333333333,0.4,2.85793526471943,26.8514431641951,6.58063913728495 +"68","2017-09-20 09:40:00",740,"µS/cm","2017-09-18 21:40:00",15.8458333541667,1,2.86923171973098,27.2029410174709,6.60665018619822 +"69","2017-10-18 09:30:00",748,"µS/cm","2017-10-16 21:30:00",11.7052083333334,0,2.87390159786446,27.3495886623547,6.61740297797448 +"70","2017-11-06 09:10:00",707,"µS/cm","2017-11-04 21:10:00",8.25520833333336,0,2.8494194137969,26.5894716006167,6.56103066589657 +"71","2018-04-09 09:50:00",886,"µS/cm","2018-04-07 21:50:00",1.3,0,2.94743372188705,29.7657521322744,6.78671695060508 +"72","2018-05-14 09:40:00",689,"µS/cm","2018-05-12 21:40:00",10.8875,0,2.83821922190763,26.2488094968134,6.53524127101366 +"73","2018-06-19 09:40:00",724,"µS/cm","2018-06-17 21:40:00",16.5937497916667,3.2,2.85973856619715,26.9072480941474,6.58479139238572 +"74","2018-07-23 08:45:00",708,"µS/cm","2018-07-21 20:45:00",17.6875,13.6,2.85003325768977,26.6082693913001,6.56244409369372 +"75","2018-08-27 09:15:00",727,"µS/cm","2018-08-25 21:15:00",17.597916375,16,2.86153441085904,26.9629375254255,6.58892647753352 +"76","2018-09-10 10:10:00",745,"µS/cm","2018-09-08 22:10:00",16.3145835208333,17,2.87215627274829,27.2946881279124,6.61338421837956 +"77","2018-10-22 09:30:00",735,"µS/cm","2018-10-20 21:30:00",8.65697569444405,0,2.8662873390842,27.1108834234519,6.59987049921284 +"78","2018-11-27 09:25:00",657,"µS/cm","2018-11-25 21:25:00",2.59166666666667,44.8,2.81756536955978,25.6320112359526,6.48768401848461 +"79","2019-04-10 09:25:00",590,"µS/cm","2019-04-08 21:25:00",3.725,0,2.77085201164214,24.2899156029822,6.38012253689976 +"80","2022-06-06 09:30:00",748,"µS/cm","2022-06-04 21:30:00",14.1879918810758,4.2,2.87390159786446,27.3495886623547,6.61740297797448 +"81","2022-07-04 08:50:00",745,"µS/cm","2022-07-02 20:50:00",17.856007265624,0,2.87215627274829,27.2946881279124,6.61338421837956 +"82","2022-08-03 09:15:00",739,"µS/cm","2022-08-01 21:15:00",18.6120949843758,7.4,2.86864443839483,27.1845544381364,6.6052979209482 +"83","2022-09-14 09:45:00",734,"µS/cm","2022-09-12 21:45:00",15.1501078706574,0.8,2.86569605991607,27.0924343682881,6.59850902861452 +"84","2022-10-04 09:45:00",772,"µS/cm","2022-10-02 21:45:00",8.93650900347281,0,2.88761730033574,27.7848879788996,6.64898455002478 +"85","2022-11-07 09:30:00",782,"µS/cm","2022-11-05 21:30:00",11.0288683263892,2.6,2.89320675305985,27.9642629082191,6.66185474054531 diff --git a/data/water_quality/do.csv b/data/water_quality/do.csv new file mode 100644 index 0000000..c84192c --- /dev/null +++ b/data/water_quality/do.csv @@ -0,0 +1,79 @@ +"","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1","2007-03-15 13:50:00",12.57,"mg/L","2007-03-14 01:50:00",1.70208564583333,0.4,1.09933527768596,3.54541958024717,2.53131302260216 +"2","2007-03-27 10:00:00",11.36,"mg/L","2007-03-25 22:00:00",2.67916204166667,2,1.055378331375,3.37045990927054,2.43009841329301 +"3","2007-05-22 09:16:00",12.51,"mg/L","2007-05-20 21:16:00",12.6718645833333,0,1.09725730969342,3.53694783676548,2.52652832447882 +"4","2007-06-19 08:50:00",11.96,"mg/L","2007-06-17 20:50:00",17.8052070833333,8.8,1.07773117965239,3.45832329315812,2.48156774852249 +"5","2007-07-16 09:03:00",10.29,"mg/L","2007-07-14 21:03:00",16.1385427083333,0,1.01241537476243,3.20780298646909,2.33117254984596 +"6","2007-08-13 09:37:00",10.66,"mg/L","2007-08-11 21:37:00",18.0302233333333,2.8,1.02775720469055,3.2649655434629,2.3664984187377 +"7","2007-09-17 10:14:00",12.51,"mg/L","2007-09-15 22:14:00",14.2031420833333,0,1.09725730969342,3.53694783676548,2.52652832447882 +"8","2007-10-22 09:23:00",9.78,"mg/L","2007-10-20 21:23:00",12.602100625,0,0.990338854787601,3.12729915422238,2.28033948404673 +"9","2008-05-21 09:01:00",9.43,"mg/L","2008-05-19 21:01:00",10.4791666666666,0,0.974511692737328,3.07083050655682,2.24389609664537 +"10","2008-06-24 09:21:00",10.06,"mg/L","2008-06-22 21:21:00",15.4875,1.8,1.00259798071991,3.17175030543074,2.30856716467159 +"11","2008-07-21 09:26:00",8.54,"mg/L","2008-07-19 21:26:00",17.81875,31.8,0.931457870689005,2.92232783924049,2.14476100780048 +"12","2008-08-12 09:15:00",8.85,"mg/L","2008-08-10 21:15:00",15.1958333333333,0,0.946943270697825,2.9748949561287,2.18041745901984 +"13","2008-09-15 09:15:00",6.51,"mg/L","2008-09-13 21:15:00",14.7927048649647,24.6,0.813580988568192,2.55147016443461,1.87333945622048 +"14","2008-10-09 08:46:00",9.76,"mg/L","2008-10-07 20:46:00",10.0437361134257,12,0.989449817666692,3.12409987036266,2.278292400425 +"15","2008-11-06 09:55:00",11.36,"mg/L","2008-11-04 21:55:00",7.03645949433987,0.2,1.055378331375,3.37045990927054,2.43009841329301 +"16","2009-03-18 09:20:00",11.14,"mg/L","2009-03-16 21:20:00",2.71458333333333,0,1.04688519083771,3.33766385365573,2.41054223449914 +"17","2009-04-06 09:40:00",11.03,"mg/L","2009-04-04 21:40:00",4.96145717977963,13.4,1.04257551244019,3.32114438108312,2.40061883326541 +"18","2009-05-05 09:35:00",10.48,"mg/L","2009-05-03 21:35:00",10.5677118094093,6.4,1.02036128264771,3.23728281124773,2.3494686788929 +"19","2009-06-15 10:00:00",9.55,"mg/L","2009-06-13 22:00:00",14.1437546219225,0,0.980003371583746,3.09030742807249,2.25654115449264 +"20","2009-07-14 09:40:00",9.33,"mg/L","2009-07-12 21:40:00",16.5927187384391,0,0.9698816437465,3.05450486986025,2.23323501485925 +"21","2009-09-14 09:00:00",8.66,"mg/L","2009-09-12 21:00:00",15.5200148148147,0,0.937517892017347,2.94278779391243,2.15871472257434 +"22","2009-10-19 09:00:00",11.91,"mg/L","2009-10-17 21:00:00",7.18541203703738,0,1.07591176148278,3.45108678534748,2.47737838336721 +"23","2009-11-23 08:55:00",10.14,"mg/L","2009-11-21 20:55:00",6.76458333333333,0,1.00603795499732,3.18433666561813,2.31648799816304 +"24","2010-04-08 09:20:00",10.07,"mg/L","2010-04-06 21:20:00",9.22083333333334,30.2,1.00302947055362,3.17332633052449,2.30956070673047 +"25","2010-04-19 09:15:00",11.77,"mg/L","2010-04-17 21:15:00",9.12083333333333,0.2,1.07077646284343,3.43074335968169,2.46555392127219 +"26","2010-05-25 09:31:00",9.83,"mg/L","2010-05-23 21:31:00",14.8197916666666,0,0.992553517832136,3.13528308131818,2.28543893415908 +"27","2010-06-21 09:20:00",9.06,"mg/L","2010-06-19 21:20:00",16.9104166666666,20,0.957128197676813,3.00998338865848,2.20386912005489 +"28","2010-07-19 09:20:00",8.77,"mg/L","2010-07-17 21:20:00",18.93125,6,0.94299959336604,2.96141857899217,2.17133680638409 +"29","2010-08-16 09:40:00",8.67,"mg/L","2010-08-14 21:40:00",18.8843645948948,0.4,0.93801909747621,2.94448637286709,2.15986879079245 +"30","2010-09-20 09:35:00",10.65,"mg/L","2010-09-18 21:35:00",13.6072997595263,0.2,1.02734960777476,3.26343377441614,2.36555989215543 +"31","2010-10-26 09:40:00",9.81,"mg/L","2010-10-24 21:40:00",9.69999999999999,11.8,0.991669007379949,3.13209195267317,2.28340227357727 +"32","2010-11-24 09:45:00",12.02,"mg/L","2010-11-22 21:45:00",6.68510638297872,10.2,1.07990446766672,3.46698716467194,2.48657192910706 +"33","2011-03-11 16:25:00",15.73,"mg/L","2011-03-10 04:25:00",1.35416666666665,37.2,1.19672872262329,3.96610640301039,2.75556971707019 +"34","2011-04-11 09:45:00",10.25,"mg/L","2011-04-09 21:45:00",4.83124999999999,6.2,1.01072386539177,3.20156211871642,2.32727770558442 +"35","2011-05-17 09:35:00",10.41,"mg/L","2011-05-15 21:35:00",11.0458333333333,7,1.01745072951054,3.22645316098034,2.34276688262688 +"36","2011-06-20 09:10:00",9.19,"mg/L","2011-06-18 21:10:00",15.8458333333333,0,0.963315511386111,3.03150127824482,2.2181159363676 +"37","2011-07-18 09:40:00",7.48,"mg/L","2011-07-16 21:40:00",17.6541666666666,0,0.873901597864461,2.73495886623547,2.01223279198639 +"38","2011-08-15 09:20:00",9.47,"mg/L","2011-08-13 21:20:00",17.3020833333332,0,0.976349979003273,3.07733651068582,2.24812890719799 +"39","2011-09-12 09:25:00",9.08,"mg/L","2011-09-10 21:25:00",15.7333333333333,0,0.958085848521085,3.01330383466387,2.2060741926132 +"40","2011-10-18 09:35:00",9.25,"mg/L","2011-10-16 21:35:00",11.6895833333333,0,0.966141732739033,3.04138126514911,2.22462355152433 +"41","2011-11-17 10:10:00",11.6,"mg/L","2011-11-15 22:10:00",7.98541666666667,0,1.06445798922692,3.40587727318528,2.45100509811232 +"42","2012-04-16 09:10:00",10.62,"mg/L","2012-04-14 21:10:00",8.08645833333318,4.6,1.02612451674545,3.25883414736006,2.36273901581379 +"43","2012-05-05 09:15:00",9.62,"mg/L","2012-05-03 21:15:00",10.925,7.6,0.983175072037813,3.10161248385416,2.26384426467762 +"44","2012-06-18 09:00:00",8.17,"mg/L","2012-06-16 21:00:00",17.6625,4.2,0.912222056532416,2.85832118559129,2.10046890887191 +"45","2012-07-16 09:00:00",8.11,"mg/L","2012-07-14 21:00:00",19.3739583333333,0,0.909020854211156,2.84780617317963,2.09309786812732 +"46","2012-08-13 09:00:00",8.85,"mg/L","2012-08-11 21:00:00",17.9444444444444,1.8,0.946943270697825,2.9748949561287,2.18041745901984 +"47","2012-09-12 09:20:00",9.73,"mg/L","2012-09-10 21:20:00",15.8007740402899,0,0.988112840268352,3.11929479209644,2.27521389619791 +"48","2012-10-15 09:20:00",8.8,"mg/L","2012-10-13 21:20:00",9.75624999999998,21.6,0.944482672150169,2.96647939483827,2.17475172148416 +"49","2012-11-13 09:15:00",11.28,"mg/L","2012-11-11 21:15:00",7.06666666666692,8.8,1.05230909964732,3.35857112474933,2.42303124606991 +"50","2013-04-18 09:10:00",10.92,"mg/L","2013-04-16 21:10:00",5.94479166666661,7.8,1.03822263836872,3.30454232837166,2.39059597031676 +"51","2013-05-16 09:20:00",9.51,"mg/L","2013-05-14 21:20:00",10.95,0.4,0.978180516937414,3.08382878902185,2.2523438765573 +"52","2013-06-17 09:45:00",9.44,"mg/L","2013-06-15 21:45:00",15.0499999999997,10.8,0.974971994298069,3.07245829914744,2.24495598015741 +"53","2013-07-09 09:20:00",7.01,"mg/L","2013-07-07 21:20:00",17.6520833333333,0.6,0.845718017966659,2.64764045897475,1.9473377010465 +"54","2013-08-13 09:30:00",8.84,"mg/L","2013-08-11 21:30:00",15.9833333333333,2,0.946452265013073,2.9732137494637,2.17928687664955 +"55","2013-09-16 09:35:00",10.18,"mg/L","2013-09-14 21:35:00",14.5572916666667,1.2,1.00774777800074,3.19061122670876,2.32042501112238 +"56","2013-10-22 09:30:00",10.36,"mg/L","2013-10-20 21:30:00",10.6666666666666,15.6,1.01535975540921,3.21869538788622,2.33795223683134 +"57","2014-04-08 14:30:00",11.71,"mg/L","2014-04-07 02:30:00",2.46666550917913,15.4,1.06855689507236,3.42198772645373,2.46044317760963 +"58","2014-05-01 11:50:00",10.08,"mg/L","2014-04-29 23:50:00",7.12291666666674,14,1.00346053210951,3.17490157327751,2.31055326264322 +"59","2014-05-12 09:40:00",10.11,"mg/L","2014-05-10 21:40:00",12.2749999999999,0,1.004751155591,3.17962261911693,2.31352503303238 +"60","2016-09-19 09:20:00",8.9,"mg/L","2016-09-17 21:20:00",15.9333334166667,0,0.949390006644913,2.98328677803526,2.18605127673809 +"61","2016-11-28 09:30:00",12.16,"mg/L","2016-11-26 21:30:00",4.9250000000001,1.6,1.08493357493672,3.48711915483254,2.49815187653802 +"62","2017-04-25 10:10:00",10.28,"mg/L","2017-04-23 22:10:00",9.125,14.4,1.01199311465926,3.20624390837628,2.33020026002702 +"63","2017-05-15 09:30:00",10.23,"mg/L","2017-05-13 21:30:00",10.5489583333333,0,1.00987563371216,3.1984371183439,2.32532457996354 +"64","2017-06-15 09:35:00",8.76,"mg/L","2017-06-13 21:35:00",16.5885416562499,0.2,0.942504106168081,2.95972971738975,2.1701959049483 +"65","2017-07-24 09:50:00",8.38,"mg/L","2017-07-22 21:50:00",17.4499998020833,1,0.923244018630276,2.89482296522603,2.12584791449399 +"66","2017-08-31 09:35:00",9.12,"mg/L","2017-08-29 21:35:00",15.5958333333333,0.4,0.959994838328416,3.0199337741083,2.21046980408624 +"67","2017-09-20 09:40:00",8.64,"mg/L","2017-09-18 21:40:00",15.8458333541667,1,0.936513742478893,2.93938769133981,2.15640258281596 +"68","2017-10-18 09:30:00",10.39,"mg/L","2017-10-16 21:30:00",11.7052083333334,0,1.01661554755718,3.22335229225724,2.34084380511114 +"69","2017-11-06 09:10:00",9.69,"mg/L","2017-11-04 21:10:00",8.25520833333336,0,0.986323777050765,3.11287648325468,2.27109442590267 +"70","2018-04-09 09:50:00",12.8,"mg/L","2018-04-07 21:50:00",1.3,0,1.10720996964787,3.57770876399966,2.54944517092557 +"71","2018-05-14 09:40:00",10.61,"mg/L","2018-05-12 21:40:00",10.8875,0,1.02571538390134,3.25729949498047,2.36179695262589 +"72","2018-06-19 09:40:00",8.65,"mg/L","2018-06-17 21:40:00",16.5937497916667,3.2,0.937016107464814,2.94108823397055,2.15755932094379 +"73","2018-07-23 08:45:00",8.62,"mg/L","2018-07-21 20:45:00",17.6875,13.6,0.935507265824713,2.93598365118064,2.1540850846756 +"74","2018-08-27 09:15:00",8.18,"mg/L","2018-08-25 21:15:00",17.597916375,16,0.912753303671323,2.86006992921502,2.10169215061466 +"75","2018-09-10 10:10:00",9.69,"mg/L","2018-09-08 22:10:00",16.3145835208333,17,0.986323777050765,3.11287648325468,2.27109442590267 +"76","2018-10-22 09:30:00",11.28,"mg/L","2018-10-20 21:30:00",8.65697569444405,0,1.05230909964732,3.35857112474933,2.42303124606991 +"77","2018-11-27 09:25:00",11.43,"mg/L","2018-11-25 21:25:00",2.59166666666667,44.8,1.05804623039528,3.38082830087539,2.43624147780672 +"78","2019-04-10 09:25:00",10.96,"mg/L","2019-04-08 21:25:00",3.725,0,1.03981055414835,3.31058907144937,2.39425228151987 diff --git a/data/water_quality/nitrate.csv b/data/water_quality/nitrate.csv new file mode 100644 index 0000000..9f161db --- /dev/null +++ b/data/water_quality/nitrate.csv @@ -0,0 +1,81 @@ +"","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1","2007-03-15 13:50:00",0.888,"mg/L","2007-03-14 01:50:00",1.70208564583333,0.4,-0.051587034221399,0.94233751915118,-0.118783535989967 +"2","2007-03-27 10:00:00",0.627,"mg/L","2007-03-25 22:00:00",2.67916204166667,2,-0.202732459169284,0.791833315793166,-0.466808738349216 +"3","2007-05-22 09:16:00",0.731,"mg/L","2007-05-20 21:16:00",12.6718645833333,0,-0.13608262304214,0.854985379991962,-0.313341819232359 +"4","2007-06-19 08:50:00",1.05,"mg/L","2007-06-17 20:50:00",17.8052070833333,8.8,0.0211892990699381,1.02469507659596,0.048790164169432 +"5","2007-07-16 09:03:00",1.11,"mg/L","2007-07-14 21:03:00",16.1385427083333,0,0.0453229787866575,1.05356537528527,0.104360015324243 +"6","2007-08-13 09:37:00",1.15,"mg/L","2007-08-11 21:37:00",18.0302233333333,2.8,0.0606978403536116,1.07238052947636,0.139761942375159 +"7","2007-09-17 10:14:00",1.23,"mg/L","2007-09-15 22:14:00",14.2031420833333,0,0.0899051114393979,1.10905365064094,0.207014169384326 +"8","2007-10-22 09:23:00",1.16,"mg/L","2007-10-20 21:23:00",12.602100625,0,0.0644579892269184,1.0770329614269,0.148420005118273 +"9","2008-05-21 09:01:00",0.705,"mg/L","2008-05-19 21:01:00",10.4791666666666,0,-0.151810883008601,0.839642781187333,-0.349557476169868 +"10","2008-06-24 09:21:00",0.794,"mg/L","2008-06-22 21:21:00",15.4875,1.8,-0.100179497572904,0.891066776397819,-0.230671817735001 +"11","2008-07-21 09:26:00",0.392,"mg/L","2008-07-19 21:26:00",17.81875,31.8,-0.406713932979543,0.626099033699941,-0.936493439191674 +"12","2008-08-12 09:15:00",0.526,"mg/L","2008-08-10 21:15:00",15.1958333333333,0,-0.279014255846261,0.72525857457875,-0.642454066244427 +"13","2008-09-15 09:15:00",0.212,"mg/L","2008-09-13 21:15:00",14.7927048649647,24.6,-0.673664139071249,0.460434577328854,-1.55116900431012 +"14","2008-10-09 08:46:00",0.831,"mg/L","2008-10-07 20:46:00",10.0437361134257,12,-0.080398976215889,0.911592014006266,-0.185125484126689 +"15","2008-11-06 09:55:00",0.82,"mg/L","2008-11-04 21:55:00",7.03645949433987,0.2,-0.0861861476162833,0.905538513813742,-0.198450938723838 +"16","2009-03-18 09:20:00",0.589,"mg/L","2009-03-16 21:20:00",2.71458333333333,0,-0.229884705212898,0.767463354173996,-0.52932909533055 +"17","2009-04-06 09:40:00",0.45,"mg/L","2009-04-04 21:40:00",4.96145717977963,13.4,-0.346787486224656,0.670820393249937,-0.798507696217772 +"18","2009-05-05 09:35:00",0.504,"mg/L","2009-05-03 21:35:00",10.5677118094093,6.4,-0.297569463554475,0.709929573971954,-0.685179010910768 +"19","2009-06-15 10:00:00",0.809,"mg/L","2009-06-13 22:00:00",14.1437546219225,0,-0.0920514783877277,0.899444272870754,-0.211956361923645 +"20","2009-07-14 09:40:00",0.957,"mg/L","2009-07-12 21:40:00",16.5927187384391,0,-0.0190880622231565,0.978263768111648,-0.0439518875291828 +"21","2009-08-10 10:10:00",0.454,"mg/L","2009-08-08 22:10:00",16.5684181286549,29,-0.342944147142896,0.673795221116921,-0.789658080940789 +"22","2009-09-14 09:00:00",0.982,"mg/L","2009-09-12 21:00:00",15.5200148148147,0,-0.00788851221305034,0.990959131347,-0.0181639706276712 +"23","2009-10-19 09:00:00",0.989,"mg/L","2009-10-17 21:00:00",7.18541203703738,0,-0.0048037084028206,0.994484791236146,-0.0110609473594249 +"24","2009-11-23 08:55:00",0.923,"mg/L","2009-11-21 20:55:00",6.76458333333333,0,-0.0347982989740879,0.960728889958036,-0.0801260444792849 +"25","2010-04-08 09:20:00",0.204,"mg/L","2010-04-06 21:20:00",9.22083333333334,30.2,-0.690369832574101,0.451663591625449,-1.58963528513792 +"26","2010-04-19 09:15:00",0.668,"mg/L","2010-04-17 21:15:00",9.12083333333333,0.2,-0.175223537524454,0.817312669668102,-0.403467105445491 +"27","2010-06-21 09:20:00",0.919,"mg/L","2010-06-19 21:20:00",16.9104166666666,20,-0.0366844886138887,0.958644876896549,-0.08446915662645 +"28","2010-07-19 09:20:00",1.09,"mg/L","2010-07-17 21:20:00",18.93125,6,0.0374264979406237,1.04403065089106,0.0861776962410524 +"29","2010-08-16 09:40:00",1.14,"mg/L","2010-08-14 21:40:00",18.8843645948948,0.4,0.0569048513364726,1.06770782520313,0.131028262406404 +"30","2010-09-20 09:35:00",0.954,"mg/L","2010-09-18 21:35:00",13.6072997595263,0.2,-0.0204516252959049,0.976729235765982,-0.0470916075338506 +"31","2010-10-26 09:40:00",0.631,"mg/L","2010-10-24 21:40:00",9.69999999999999,11.8,-0.199970640755866,0.79435508432942,-0.460449416440924 +"32","2010-11-24 09:45:00",0.633,"mg/L","2010-11-22 21:45:00",6.68510638297872,10.2,-0.198596289982645,0.795612971236643,-0.457284856837961 +"33","2011-03-11 16:25:00",0.534,"mg/L","2011-03-10 04:25:00",1.35416666666665,37.2,-0.272458742971444,0.730753036257804,-0.627359440021942 +"34","2011-04-11 09:45:00",0.456,"mg/L","2011-04-09 21:45:00",4.83124999999999,6.2,-0.341035157335565,0.675277720645365,-0.785262469467751 +"35","2011-05-17 09:35:00",0.325,"mg/L","2011-05-15 21:35:00",11.0458333333333,7,-0.488116639021126,0.570087712549569,-1.1239300966524 +"36","2011-06-20 09:10:00",0.863,"mg/L","2011-06-18 21:10:00",15.8458333333333,0,-0.0639892042847904,0.928977932999487,-0.147340587898709 +"37","2011-07-18 09:40:00",1.13,"mg/L","2011-07-16 21:40:00",17.6541666666666,0,0.0530784434834197,1.06301458127346,0.122217632724249 +"38","2011-11-17 10:10:00",0.752,"mg/L","2011-11-15 22:10:00",7.98541666666667,0,-0.123782159408358,0.867179335547152,-0.285018955032297 +"39","2012-04-16 09:10:00",1.07,"mg/L","2012-04-14 21:10:00",8.08645833333318,4.6,0.0293837776852097,1.03440804327886,0.0676586484738149 +"40","2012-05-05 09:15:00",0.661,"mg/L","2012-05-03 21:15:00",10.925,7.6,-0.17979854051436,0.813019064967114,-0.414001439130451 +"41","2012-06-18 09:00:00",0.875,"mg/L","2012-06-16 21:00:00",17.6625,4.2,-0.0579919469776868,0.935414346693485,-0.133531392624523 +"42","2012-07-16 09:00:00",0.967,"mg/L","2012-07-14 21:00:00",19.3739583333333,0,-0.0145735259169983,0.983361581515162,-0.0335567835288428 +"43","2012-08-13 09:00:00",0.797,"mg/L","2012-08-11 21:00:00",17.9444444444444,1.8,-0.0985416786038876,0.892748564826626,-0.226900600191922 +"44","2012-09-12 09:20:00",0.842,"mg/L","2012-09-10 21:20:00",15.8007740402899,0,-0.0746879085003505,0.917605579756357,-0.17197526473981 +"45","2012-10-15 09:20:00",0.552,"mg/L","2012-10-13 21:20:00",9.75624999999998,21.6,-0.258060922270801,0.742967024840268,-0.594207232705042 +"46","2012-11-13 09:15:00",0.866,"mg/L","2012-11-11 21:15:00",7.06666666666692,8.8,-0.0624821079826534,0.930591209930547,-0.143870370419702 +"47","2013-04-18 09:10:00",0.457,"mg/L","2013-04-16 21:10:00",5.94479166666661,7.8,-0.34008379993015,0.676017751246223,-0.783071888087932 +"48","2013-05-16 09:20:00",0.648,"mg/L","2013-05-14 21:20:00",10.95,0.4,-0.188424994129407,0.804984471899924,-0.433864582629862 +"49","2013-06-17 09:45:00",0.538,"mg/L","2013-06-15 21:45:00",15.0499999999997,10.8,-0.269217724333611,0.73348483283569,-0.619896718820353 +"50","2013-07-09 09:20:00",0.434,"mg/L","2013-07-07 21:20:00",17.6520833333333,0.6,-0.362510270487489,0.658786763680024,-0.834710744881732 +"51","2013-08-13 09:30:00",0.869,"mg/L","2013-08-11 21:30:00",15.9833333333333,2,-0.0609802235513335,0.932201694913713,-0.140412153716745 +"52","2013-09-16 09:35:00",0.843,"mg/L","2013-09-14 21:35:00",14.5572916666667,1.2,-0.0741724253752577,0.918150314491042,-0.170788320980282 +"53","2013-10-22 09:30:00",0.463,"mg/L","2013-10-20 21:30:00",10.6666666666666,15.6,-0.334419008982047,0.68044103344816,-0.770028224895903 +"54","2014-04-08 14:30:00",0.509,"mg/L","2014-04-07 02:30:00",2.46666550917913,15.4,-0.293282217663241,0.713442359269479,-0.675307262431614 +"55","2014-05-01 11:50:00",0.37,"mg/L","2014-04-29 23:50:00",7.12291666666674,14,-0.431798275933005,0.608276253029822,-0.994252273343867 +"56","2016-09-19 09:20:00",0.925,"mg/L","2016-09-17 21:20:00",15.9333334166667,0,-0.0338582672609674,0.961769203083567,-0.0779615414697118 +"57","2016-11-28 09:30:00",0.8,"mg/L","2016-11-26 21:30:00",4.9250000000001,1.6,-0.0969100130080564,0.894427190999916,-0.22314355131421 +"58","2017-04-25 10:10:00",0.53,"mg/L","2017-04-23 22:10:00",9.125,14.4,-0.275724130399211,0.728010988928052,-0.63487827243597 +"59","2017-05-15 09:30:00",0.616,"mg/L","2017-05-13 21:30:00",10.5489583333333,0,-0.210419287835575,0.784856674813943,-0.484508315448617 +"60","2017-06-15 09:35:00",0.878,"mg/L","2017-06-13 21:35:00",16.5885416562499,0.2,-0.0565054840938974,0.937016542009798,-0.13010868534702 +"61","2017-07-24 09:50:00",0.833,"mg/L","2017-07-22 21:50:00",17.4499998020833,1,-0.0793549985932124,0.912688336728371,-0.182721636815294 +"62","2017-08-31 09:35:00",1.02,"mg/L","2017-08-29 21:35:00",15.5958333333333,0.4,0.00860017176191757,1.00995049383621,0.0198026272961797 +"63","2017-09-20 09:40:00",1.1,"mg/L","2017-09-18 21:40:00",15.8458333541667,1,0.0413926851582251,1.04880884817015,0.0953101798043249 +"64","2017-10-18 09:30:00",0.983,"mg/L","2017-10-16 21:30:00",11.7052083333334,0,-0.00744648216786438,0.991463564635635,-0.0171461588349705 +"65","2017-11-06 09:10:00",0.431,"mg/L","2017-11-04 21:10:00",8.25520833333336,0,-0.365522729839268,0.656505902486794,-0.841647188878389 +"66","2018-04-09 09:50:00",0.73,"mg/L","2018-04-07 21:50:00",1.3,0,-0.136677139879544,0.854400374531753,-0.3147107448397 +"67","2018-05-14 09:40:00",0.76,"mg/L","2018-05-12 21:40:00",10.8875,0,-0.119186407719209,0.871779788708135,-0.27443684570176 +"68","2018-06-19 09:40:00",1.02,"mg/L","2018-06-17 21:40:00",16.5937497916667,3.2,0.00860017176191757,1.00995049383621,0.0198026272961797 +"69","2018-07-23 08:45:00",5.96,"mg/L","2018-07-21 20:45:00",17.6875,13.6,0.775246259740236,2.44131112314674,1.78507048107726 +"70","2018-08-27 09:15:00",0.73,"mg/L","2018-08-25 21:15:00",17.597916375,16,-0.136677139879544,0.854400374531753,-0.3147107448397 +"71","2018-09-10 10:10:00",1.09,"mg/L","2018-09-08 22:10:00",16.3145835208333,17,0.0374264979406237,1.04403065089106,0.0861776962410524 +"72","2018-10-22 09:30:00",0.73,"mg/L","2018-10-20 21:30:00",8.65697569444405,0,-0.136677139879544,0.854400374531753,-0.3147107448397 +"73","2018-11-27 09:25:00",0.54,"mg/L","2018-11-25 21:25:00",2.59166666666667,44.8,-0.267606240177031,0.734846922834953,-0.616186139423817 +"74","2019-04-10 09:25:00",0.394,"mg/L","2019-04-08 21:25:00",3.725,0,-0.404503778174426,0.627694193059009,-0.931404369684203 +"75","2022-06-06 09:30:00",1.22,"mg/L","2022-06-04 21:30:00",14.1879918810758,4.2,0.0863598306747482,1.10453610171873,0.198850858745165 +"76","2022-07-04 08:50:00",1.17,"mg/L","2022-07-02 20:50:00",17.856007265624,0,0.0681858617461616,1.0816653826392,0.157003748809665 +"77","2022-08-03 09:15:00",1.31,"mg/L","2022-08-01 21:15:00",18.6120949843758,7.4,0.117271295655764,1.14455231422596,0.27002713721306 +"78","2022-09-14 09:45:00",1.28,"mg/L","2022-09-12 21:45:00",15.1501078706574,0.8,0.107209969647868,1.13137084989848,0.246860077931526 +"79","2022-10-04 09:45:00",1.39,"mg/L","2022-10-02 21:45:00",8.93650900347281,0,0.143014800254095,1.17898261225516,0.3293037471426 +"80","2022-11-07 09:30:00",0.97,"mg/L","2022-11-05 21:30:00",11.0288683263892,2.6,-0.0132282657337552,0.98488578017961,-0.0304592074847086 diff --git a/data/water_quality/nitrite.csv b/data/water_quality/nitrite.csv new file mode 100644 index 0000000..c0581d0 --- /dev/null +++ b/data/water_quality/nitrite.csv @@ -0,0 +1,77 @@ +"","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1","2007-03-15 13:50:00",0.009,"mg/L","2007-03-14 01:50:00",1.70208564583333,0.4,-2.04575749056068,0.0948683298050514,-4.71053070164592 +"2","2007-03-27 10:00:00",0.016,"mg/L","2007-03-25 22:00:00",2.67916204166667,2,-1.79588001734408,0.126491106406735,-4.13516655674236 +"3","2007-05-22 09:16:00",0.005,"mg/L","2007-05-20 21:16:00",12.6718645833333,0,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"4","2007-06-19 08:50:00",0.01,"mg/L","2007-06-17 20:50:00",17.8052070833333,8.8,-2,0.1,-4.60517018598809 +"5","2007-07-16 09:03:00",0.003,"mg/L","2007-07-14 21:03:00",16.1385427083333,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"6","2007-08-13 09:37:00",0.003,"mg/L","2007-08-11 21:37:00",18.0302233333333,2.8,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"7","2007-09-17 10:14:00",0.001,"mg/L","2007-09-15 22:14:00",14.2031420833333,0,-3,0.0316227766016838,-6.90775527898214 +"8","2007-10-22 09:23:00",0.003,"mg/L","2007-10-20 21:23:00",12.602100625,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"9","2008-05-21 09:01:00",0.002,"mg/L","2008-05-19 21:01:00",10.4791666666666,0,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"10","2008-06-24 09:21:00",0.004,"mg/L","2008-06-22 21:21:00",15.4875,1.8,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"11","2008-07-21 09:26:00",0.006,"mg/L","2008-07-19 21:26:00",17.81875,31.8,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"12","2008-08-12 09:15:00",0.003,"mg/L","2008-08-10 21:15:00",15.1958333333333,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"13","2008-09-15 09:15:00",0.005,"mg/L","2008-09-13 21:15:00",14.7927048649647,24.6,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"14","2008-10-09 08:46:00",0.004,"mg/L","2008-10-07 20:46:00",10.0437361134257,12,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"15","2008-11-06 09:55:00",0.003,"mg/L","2008-11-04 21:55:00",7.03645949433987,0.2,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"16","2009-03-18 09:20:00",0.005,"mg/L","2009-03-16 21:20:00",2.71458333333333,0,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"17","2009-04-06 09:40:00",0.004,"mg/L","2009-04-04 21:40:00",4.96145717977963,13.4,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"18","2009-05-05 09:35:00",0.004,"mg/L","2009-05-03 21:35:00",10.5677118094093,6.4,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"19","2009-06-15 10:00:00",0.002,"mg/L","2009-06-13 22:00:00",14.1437546219225,0,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"20","2009-07-14 09:40:00",0.003,"mg/L","2009-07-12 21:40:00",16.5927187384391,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"21","2009-08-10 10:10:00",0.006,"mg/L","2009-08-08 22:10:00",16.5684181286549,29,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"22","2009-09-14 09:00:00",0.003,"mg/L","2009-09-12 21:00:00",15.5200148148147,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"23","2009-10-19 09:00:00",0.003,"mg/L","2009-10-17 21:00:00",7.18541203703738,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"24","2009-11-23 08:55:00",0.004,"mg/L","2009-11-21 20:55:00",6.76458333333333,0,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"25","2010-04-08 09:20:00",0.004,"mg/L","2010-04-06 21:20:00",9.22083333333334,30.2,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"26","2010-04-19 09:15:00",0.003,"mg/L","2010-04-17 21:15:00",9.12083333333333,0.2,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"27","2010-05-25 09:31:00",0.005,"mg/L","2010-05-23 21:31:00",14.8197916666666,0,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"28","2010-06-21 09:20:00",0.004,"mg/L","2010-06-19 21:20:00",16.9104166666666,20,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"29","2010-07-19 09:20:00",0.006,"mg/L","2010-07-17 21:20:00",18.93125,6,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"30","2010-08-16 09:40:00",0.006,"mg/L","2010-08-14 21:40:00",18.8843645948948,0.4,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"31","2010-09-20 09:35:00",0.004,"mg/L","2010-09-18 21:35:00",13.6072997595263,0.2,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"32","2010-10-26 09:40:00",0.004,"mg/L","2010-10-24 21:40:00",9.69999999999999,11.8,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"33","2010-11-24 09:45:00",0.004,"mg/L","2010-11-22 21:45:00",6.68510638297872,10.2,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"34","2011-03-11 16:25:00",0.007,"mg/L","2011-03-10 04:25:00",1.35416666666665,37.2,-2.15490195998574,0.0836660026534076,-4.96184512992682 +"35","2011-04-11 09:45:00",0.004,"mg/L","2011-04-09 21:45:00",4.83124999999999,6.2,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"36","2011-05-17 09:35:00",0.004,"mg/L","2011-05-15 21:35:00",11.0458333333333,7,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"37","2011-06-20 09:10:00",0.01,"mg/L","2011-06-18 21:10:00",15.8458333333333,0,-2,0.1,-4.60517018598809 +"38","2011-07-18 09:40:00",0.006,"mg/L","2011-07-16 21:40:00",17.6541666666666,0,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"39","2011-09-12 09:25:00",0.004,"mg/L","2011-09-10 21:25:00",15.7333333333333,0,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"40","2011-11-17 10:10:00",0.005,"mg/L","2011-11-15 22:10:00",7.98541666666667,0,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"41","2012-04-16 09:10:00",0.006,"mg/L","2012-04-14 21:10:00",8.08645833333318,4.6,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"42","2012-05-05 09:15:00",0.009,"mg/L","2012-05-03 21:15:00",10.925,7.6,-2.04575749056068,0.0948683298050514,-4.71053070164592 +"43","2012-06-18 09:00:00",0.013,"mg/L","2012-06-16 21:00:00",17.6625,4.2,-1.88605664769316,0.114017542509914,-4.3428059215206 +"44","2012-07-16 09:00:00",0.006,"mg/L","2012-07-14 21:00:00",19.3739583333333,0,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"45","2012-08-13 09:00:00",0.006,"mg/L","2012-08-11 21:00:00",17.9444444444444,1.8,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"46","2012-09-12 09:20:00",0.004,"mg/L","2012-09-10 21:20:00",15.8007740402899,0,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"47","2012-10-15 09:20:00",0.015,"mg/L","2012-10-13 21:20:00",9.75624999999998,21.6,-1.82390874094432,0.122474487139159,-4.19970507787993 +"48","2012-11-13 09:15:00",0.006,"mg/L","2012-11-11 21:15:00",7.06666666666692,8.8,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"49","2013-04-18 09:10:00",0.005,"mg/L","2013-04-16 21:10:00",5.94479166666661,7.8,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"50","2013-05-16 09:20:00",0.006,"mg/L","2013-05-14 21:20:00",10.95,0.4,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"51","2013-06-17 09:45:00",0.008,"mg/L","2013-06-15 21:45:00",15.0499999999997,10.8,-2.09691001300806,0.0894427190999916,-4.8283137373023 +"52","2013-07-09 09:20:00",0.006,"mg/L","2013-07-07 21:20:00",17.6520833333333,0.6,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"53","2013-08-13 09:30:00",0.002,"mg/L","2013-08-11 21:30:00",15.9833333333333,2,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"54","2013-09-16 09:35:00",0.003,"mg/L","2013-09-14 21:35:00",14.5572916666667,1.2,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"55","2013-10-22 09:30:00",0.004,"mg/L","2013-10-20 21:30:00",10.6666666666666,15.6,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"56","2014-04-08 14:30:00",0.007,"mg/L","2014-04-07 02:30:00",2.46666550917913,15.4,-2.15490195998574,0.0836660026534076,-4.96184512992682 +"57","2014-05-01 11:50:00",0.004,"mg/L","2014-04-29 23:50:00",7.12291666666674,14,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"58","2016-09-19 09:20:00",0.002,"mg/L","2016-09-17 21:20:00",15.9333334166667,0,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"59","2016-11-28 09:30:00",0.002,"mg/L","2016-11-26 21:30:00",4.9250000000001,1.6,-2.69897000433602,0.0447213595499958,-6.21460809842219 +"60","2017-04-25 10:10:00",0.006,"mg/L","2017-04-23 22:10:00",9.125,14.4,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"61","2017-05-15 09:30:00",0.003,"mg/L","2017-05-13 21:30:00",10.5489583333333,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"62","2017-06-15 09:35:00",0.005,"mg/L","2017-06-13 21:35:00",16.5885416562499,0.2,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"63","2017-07-24 09:50:00",0.005,"mg/L","2017-07-22 21:50:00",17.4499998020833,1,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"64","2017-08-31 09:35:00",0.005,"mg/L","2017-08-29 21:35:00",15.5958333333333,0.4,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"65","2017-09-20 09:40:00",0.004,"mg/L","2017-09-18 21:40:00",15.8458333541667,1,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"66","2017-10-18 09:30:00",0.003,"mg/L","2017-10-16 21:30:00",11.7052083333334,0,-2.52287874528034,0.0547722557505166,-5.80914299031403 +"67","2017-11-06 09:10:00",0.005,"mg/L","2017-11-04 21:10:00",8.25520833333336,0,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"68","2018-04-09 09:50:00",0,"mg/L","2018-04-07 21:50:00",1.3,0,0,0,0 +"69","2018-05-14 09:40:00",0,"mg/L","2018-05-12 21:40:00",10.8875,0,0,0,0 +"70","2018-06-19 09:40:00",0,"mg/L","2018-06-17 21:40:00",16.5937497916667,3.2,0,0,0 +"71","2018-07-23 08:45:00",0,"mg/L","2018-07-21 20:45:00",17.6875,13.6,0,0,0 +"72","2018-08-27 09:15:00",0,"mg/L","2018-08-25 21:15:00",17.597916375,16,0,0,0 +"73","2018-09-10 10:10:00",0,"mg/L","2018-09-08 22:10:00",16.3145835208333,17,0,0,0 +"74","2018-10-22 09:30:00",0,"mg/L","2018-10-20 21:30:00",8.65697569444405,0,0,0,0 +"75","2018-11-27 09:25:00",0,"mg/L","2018-11-25 21:25:00",2.59166666666667,44.8,0,0,0 +"76","2019-04-10 09:25:00",0.004,"mg/L","2019-04-08 21:25:00",3.725,0,-2.39794000867204,0.0632455532033676,-5.52146091786225 diff --git a/data/water_quality/ph.csv b/data/water_quality/ph.csv new file mode 100644 index 0000000..7b6a958 --- /dev/null +++ b/data/water_quality/ph.csv @@ -0,0 +1,86 @@ +"","X.1","X","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1",1,1,"2007-03-15 13:50:00",7.73,"N/A","2007-03-14 01:50:00",1.70208564583333,0.4,0.888179493918325,2.78028775489157,2.04510886259933 +"2",2,2,"2007-03-27 10:00:00",7.81,"N/A","2007-03-25 22:00:00",2.67916204166667,2,0.8926510338773,2.79463772249642,2.05540496385159 +"3",3,3,"2007-05-22 09:16:00",8.29,"N/A","2007-05-20 21:16:00",12.6718645833333,0,0.918554530550273,2.87923600977759,2.1150499691472 +"4",4,4,"2007-06-19 08:50:00",8.57,"N/A","2007-06-17 20:50:00",17.8052070833333,8.8,0.932980821923198,2.92745623366089,2.14826773260969 +"5",5,5,"2007-07-16 09:03:00",8.22,"N/A","2007-07-14 21:03:00",16.1385427083333,0,0.91487181754005,2.86705423736629,2.10657020906809 +"6",6,6,"2007-08-13 09:37:00",8.04,"N/A","2007-08-11 21:37:00",18.0302233333333,2.8,0.905256048748451,2.83548937575156,2.08442908319087 +"7",7,7,"2007-09-17 10:14:00",8.71,"N/A","2007-09-15 22:14:00",14.2031420833333,0,0.940018155007663,2.95127091267474,2.16447179086441 +"8",8,8,"2007-10-22 09:23:00",8.07,"N/A","2007-10-20 21:23:00",12.602100625,0,0.90687353472207,2.84077454226836,2.08815348228186 +"9",9,9,"2008-05-21 09:01:00",8.25,"N/A","2008-05-19 21:01:00",10.4791666666666,0,0.916453948549925,2.87228132326901,2.11021320034659 +"10",10,10,"2008-06-24 09:21:00",8.51,"N/A","2008-06-22 21:21:00",15.4875,1.8,0.929929560084588,2.91719042916296,2.14124194258528 +"11",11,11,"2008-07-21 09:26:00",8.1,"N/A","2008-07-19 21:26:00",17.81875,31.8,0.90848501887865,2.84604989415154,2.09186406167839 +"12",12,12,"2008-08-12 09:15:00",7.96,"N/A","2008-08-10 21:15:00",15.1958333333333,0,0.900913067737669,2.82134719593318,2.07442899985629 +"13",13,13,"2008-09-15 09:15:00",7.64,"N/A","2008-09-13 21:15:00",14.7927048649647,24.6,0.88309335857569,2.76405499221705,2.03339760317843 +"14",14,14,"2008-10-09 08:46:00",8,"N/A","2008-10-07 20:46:00",10.0437361134257,12,0.903089986991944,2.82842712474619,2.07944154167984 +"15",15,15,"2008-11-06 09:55:00",7.98,"N/A","2008-11-04 21:55:00",7.03645949433987,0.2,0.902002891350729,2.82488937836511,2.07693841146172 +"16",16,16,"2009-03-18 09:20:00",7.86,"N/A","2009-03-16 21:20:00",2.71458333333333,0,0.895422546039408,2.80356915377524,2.06178660644112 +"17",17,17,"2009-04-06 09:40:00",7.9,"N/A","2009-04-04 21:40:00",4.96145717977963,13.4,0.897627091290441,2.81069386451104,2.06686275947298 +"18",18,18,"2009-05-05 09:35:00",8.16,"N/A","2009-05-03 21:35:00",10.5677118094093,6.4,0.911690158753861,2.85657137141714,2.09924416897602 +"19",19,19,"2009-06-15 10:00:00",8.17,"N/A","2009-06-13 22:00:00",14.1437546219225,0,0.912222056532416,2.85832118559129,2.10046890887191 +"20",20,20,"2009-07-14 09:40:00",8.11,"N/A","2009-07-12 21:40:00",16.5927187384391,0,0.909020854211156,2.84780617317963,2.09309786812732 +"21",21,21,"2009-09-14 09:00:00",8.12,"N/A","2009-09-12 21:00:00",15.5200148148147,0,0.909556029241175,2.849561369755,2.09433015417359 +"22",22,22,"2009-10-19 09:00:00",8.02,"N/A","2009-10-17 21:00:00",7.18541203703738,0,0.904174368284164,2.83196045170126,2.08193842187842 +"23",23,23,"2009-11-23 08:55:00",7.94,"N/A","2009-11-21 20:55:00",6.76458333333333,0,0.899820502427096,2.81780056072107,2.07191327525904 +"24",24,24,"2010-04-08 09:20:00",7.95,"N/A","2010-04-06 21:20:00",9.22083333333334,30.2,0.90036712865647,2.81957443597434,2.07317192866624 +"25",25,25,"2010-04-19 09:15:00",8.15,"N/A","2010-04-17 21:15:00",9.12083333333333,0.2,0.911157608739977,2.85482048472404,2.09801792725277 +"26",26,26,"2010-05-25 09:31:00",8.06,"N/A","2010-05-23 21:31:00",14.8197916666666,0,0.906335041805091,2.83901391331568,2.08691355651854 +"27",27,27,"2010-06-21 09:20:00",8.01,"N/A","2010-06-19 21:20:00",16.9104166666666,20,0.903632516084238,2.83019433961698,2.08069076108027 +"28",28,28,"2010-07-19 09:20:00",7.99,"N/A","2010-07-17 21:20:00",18.93125,6,0.902546779313991,2.82665880502051,2.07819075977818 +"29",29,29,"2010-08-16 09:40:00",8.06,"N/A","2010-08-14 21:40:00",18.8843645948948,0.4,0.906335041805091,2.83901391331568,2.08691355651854 +"30",30,30,"2010-09-20 09:35:00",8.27,"N/A","2010-09-18 21:35:00",13.6072997595263,0.2,0.917505509552547,2.87576076890968,2.1126345090356 +"31",31,31,"2010-10-26 09:40:00",7.96,"N/A","2010-10-24 21:40:00",9.69999999999999,11.8,0.900913067737669,2.82134719593318,2.07442899985629 +"32",32,32,"2010-11-24 09:45:00",7.74,"N/A","2010-11-22 21:45:00",6.68510638297872,10.2,0.888740960682893,2.78208554864871,2.04640168760164 +"33",33,33,"2011-03-11 16:25:00",7.54,"N/A","2011-03-10 04:25:00",1.35416666666665,37.2,0.877371345869774,2.7459060435492,2.02022218201986 +"34",34,34,"2011-04-11 09:45:00",7.89,"N/A","2011-04-09 21:45:00",4.83124999999999,6.2,0.89707700320942,2.80891438103763,2.06559613485778 +"35",35,35,"2011-05-17 09:35:00",8.03,"N/A","2011-05-15 21:35:00",11.0458333333333,7,0.904715545278681,2.83372546306095,2.08318452795867 +"36",36,36,"2011-06-20 09:10:00",8.05,"N/A","2011-06-18 21:10:00",15.8458333333333,0,0.905795880367869,2.83725219182222,2.08567209143047 +"37",37,37,"2011-07-18 09:40:00",7.97,"N/A","2011-07-16 21:40:00",17.6541666666666,0,0.901458321396112,2.82311884269862,2.07568449280212 +"38",38,38,"2011-08-15 09:20:00",8.11,"N/A","2011-08-13 21:20:00",17.3020833333332,0,0.909020854211156,2.84780617317963,2.09309786812732 +"39",39,39,"2011-09-12 09:25:00",8.05,"N/A","2011-09-10 21:25:00",15.7333333333333,0,0.905795880367869,2.83725219182222,2.08567209143047 +"40",40,40,"2011-10-18 09:35:00",7.75,"N/A","2011-10-16 21:35:00",11.6895833333333,0,0.88930170250631,2.78388218141501,2.04769284336526 +"41",41,41,"2011-11-17 10:10:00",8.52,"N/A","2011-11-15 22:10:00",7.98541666666667,0,0.9304395947667,2.91890390386528,2.14241634084122 +"42",42,42,"2012-04-16 09:10:00",8.05,"N/A","2012-04-14 21:10:00",8.08645833333318,4.6,0.905795880367869,2.83725219182222,2.08567209143047 +"43",43,43,"2012-05-05 09:15:00",8.15,"N/A","2012-05-03 21:15:00",10.925,7.6,0.911157608739977,2.85482048472404,2.09801792725277 +"44",44,44,"2012-06-18 09:00:00",8.04,"N/A","2012-06-16 21:00:00",17.6625,4.2,0.905256048748451,2.83548937575156,2.08442908319087 +"45",45,45,"2012-07-16 09:00:00",7.94,"N/A","2012-07-14 21:00:00",19.3739583333333,0,0.899820502427096,2.81780056072107,2.07191327525904 +"46",46,46,"2012-08-13 09:00:00",7.83,"N/A","2012-08-11 21:00:00",17.9444444444444,1.8,0.893761762057943,2.79821371592664,2.05796251000271 +"47",47,47,"2012-09-12 09:20:00",8.2,"N/A","2012-09-10 21:20:00",15.8007740402899,0,0.913813852383717,2.86356421265527,2.10413415427021 +"48",48,48,"2012-10-15 09:20:00",8.01,"N/A","2012-10-13 21:20:00",9.75624999999998,21.6,0.903632516084238,2.83019433961698,2.08069076108027 +"49",49,49,"2012-11-13 09:15:00",8,"N/A","2012-11-11 21:15:00",7.06666666666692,8.8,0.903089986991944,2.82842712474619,2.07944154167984 +"50",50,50,"2013-04-18 09:10:00",7.9,"N/A","2013-04-16 21:10:00",5.94479166666661,7.8,0.897627091290441,2.81069386451104,2.06686275947298 +"51",51,51,"2013-05-16 09:20:00",8.05,"N/A","2013-05-14 21:20:00",10.95,0.4,0.905795880367869,2.83725219182222,2.08567209143047 +"52",52,52,"2013-06-17 09:45:00",7.91,"N/A","2013-06-15 21:45:00",15.0499999999997,10.8,0.898176483497677,2.81247222208505,2.06812778177956 +"53",53,53,"2013-07-09 09:20:00",8.19,"N/A","2013-07-07 21:20:00",17.6520833333333,0.6,0.913283901760418,2.86181760425084,2.10291389786498 +"54",54,54,"2013-07-09 09:20:00",8.19,"N/A","2013-07-07 21:20:00",17.6520833333333,0.6,0.913283901760418,2.86181760425084,2.10291389786498 +"55",55,55,"2013-08-13 09:30:00",7.84,"N/A","2013-08-11 21:30:00",15.9833333333333,2,0.894316062684438,2.8,2.05923883436232 +"56",56,56,"2013-09-16 09:35:00",7.85,"N/A","2013-09-14 21:35:00",14.5572916666667,1.2,0.894869656745253,2.80178514522438,2.06051353179432 +"57",57,57,"2013-10-22 09:30:00",7.62,"N/A","2013-10-20 21:30:00",10.6666666666666,15.6,0.8819549713396,2.76043474836845,2.03077636969855 +"58",58,58,"2014-04-08 14:30:00",7.9,"N/A","2014-04-07 02:30:00",2.46666550917913,15.4,0.897627091290441,2.81069386451104,2.06686275947298 +"59",59,59,"2014-05-01 11:50:00",7.88,"N/A","2014-04-29 23:50:00",7.12291666666674,14,0.896526217489555,2.80713376952364,2.06432790386979 +"60",60,60,"2014-05-12 09:40:00",8.13,"N/A","2014-05-10 21:40:00",12.2749999999999,0,0.910090545594068,2.85131548587665,2.09556092355972 +"61",61,61,"2016-09-19 09:20:00",8.41,"N/A","2016-09-17 21:20:00",15.9333334166667,0,0.924795995797912,2.9,2.12942147398486 +"62",62,62,"2016-11-28 09:30:00",8.48,"N/A","2016-11-26 21:30:00",4.9250000000001,1.6,0.928395852256714,2.91204395571221,2.13771044980381 +"63",63,63,"2017-04-25 10:10:00",8.71,"N/A","2017-04-23 22:10:00",9.125,14.4,0.940018155007663,2.95127091267474,2.16447179086441 +"64",64,64,"2017-05-15 09:30:00",8.65,"N/A","2017-05-13 21:30:00",10.5489583333333,0,0.937016107464814,2.94108823397055,2.15755932094379 +"65",65,65,"2017-06-15 09:35:00",8.18,"N/A","2017-06-13 21:35:00",16.5885416562499,0.2,0.912753303671323,2.86006992921502,2.10169215061466 +"66",66,66,"2017-07-24 09:50:00",8.12,"N/A","2017-07-22 21:50:00",17.4499998020833,1,0.909556029241175,2.849561369755,2.09433015417359 +"67",67,67,"2017-08-31 09:35:00",8.11,"N/A","2017-08-29 21:35:00",15.5958333333333,0.4,0.909020854211156,2.84780617317963,2.09309786812732 +"68",68,68,"2017-09-20 09:40:00",8.17,"N/A","2017-09-18 21:40:00",15.8458333541667,1,0.912222056532416,2.85832118559129,2.10046890887191 +"69",69,69,"2017-10-18 09:30:00",8.41,"N/A","2017-10-16 21:30:00",11.7052083333334,0,0.924795995797912,2.9,2.12942147398486 +"70",70,70,"2017-11-06 09:10:00",8.45,"N/A","2017-11-04 21:10:00",8.25520833333336,0,0.926856708949692,2.90688837074973,2.13416644136908 +"71",71,71,"2018-04-09 09:50:00",8.29,"N/A","2018-04-07 21:50:00",1.3,0,0.918554530550273,2.87923600977759,2.1150499691472 +"72",72,72,"2018-05-14 09:40:00",7.86,"N/A","2018-05-12 21:40:00",10.8875,0,0.895422546039408,2.80356915377524,2.06178660644112 +"73",73,73,"2018-06-19 09:40:00",8.38,"N/A","2018-06-17 21:40:00",16.5937497916667,3.2,0.923244018630276,2.89482296522603,2.12584791449399 +"74",74,74,"2018-07-23 08:45:00",8.45,"N/A","2018-07-21 20:45:00",17.6875,13.6,0.926856708949692,2.90688837074973,2.13416644136908 +"75",75,75,"2018-08-27 09:15:00",8.5,"N/A","2018-08-25 21:15:00",17.597916375,16,0.929418925714293,2.91547594742265,2.14006616349627 +"76",76,76,"2018-09-10 10:10:00",8.71,"N/A","2018-09-08 22:10:00",16.3145835208333,17,0.940018155007663,2.95127091267474,2.16447179086441 +"77",77,77,"2018-10-22 09:30:00",8.32,"N/A","2018-10-20 21:30:00",8.65697569444405,0,0.920123326290724,2.88444102037119,2.11866225483312 +"78",78,78,"2018-11-27 09:25:00",8.23,"N/A","2018-11-25 21:25:00",2.59166666666667,44.8,0.91539983521227,2.86879765755621,2.10778601468898 +"79",79,79,"2019-04-10 09:25:00",8.33,"N/A","2019-04-08 21:25:00",3.725,0,0.920645001406788,2.88617393793236,2.11986345617875 +"80",80,80,"2022-06-06 09:30:00",8.02,"N/A","2022-06-04 21:30:00",14.1879918810758,4.2,0.904174368284164,2.83196045170126,2.08193842187842 +"81",81,81,"2022-07-04 08:50:00",8.07,"N/A","2022-07-02 20:50:00",17.856007265624,0,0.90687353472207,2.84077454226836,2.08815348228186 +"82",82,82,"2022-08-03 09:15:00",8.09,"N/A","2022-08-01 21:15:00",18.6120949843758,7.4,0.907948521612272,2.84429253066558,2.0906287310704 +"83",83,83,"2022-09-14 09:45:00",8.15,"N/A","2022-09-12 21:45:00",15.1501078706574,0.8,0.911157608739977,2.85482048472404,2.09801792725277 +"84",84,84,"2022-10-04 09:45:00",8.18,"N/A","2022-10-02 21:45:00",8.93650900347281,0,0.912753303671323,2.86006992921502,2.10169215061466 +"85",85,85,"2022-11-07 09:30:00",8.22,"N/A","2022-11-05 21:30:00",11.0288683263892,2.6,0.91487181754005,2.86705423736629,2.10657020906809 diff --git a/data/water_quality/phosphate.csv b/data/water_quality/phosphate.csv new file mode 100644 index 0000000..2644453 --- /dev/null +++ b/data/water_quality/phosphate.csv @@ -0,0 +1,75 @@ +"","X","Collection_Timestamp","Result","Units","Start_36hr_Period","Mean_Water_Temp","Total_Precipitation","log_transformed","sqrt_transformed","ln_transformed" +"1",1,"2007-03-15 13:50:00",0.0096,"mg/L","2007-03-14 01:50:00",1.70208564583333,0.4,-2.01772876696043,0.0979795897113271,-4.64599218050835 +"2",2,"2007-03-27 10:00:00",0.0154,"mg/L","2007-03-25 22:00:00",2.67916204166667,2,-1.81247927916354,0.124096736459909,-4.17338776956255 +"3",3,"2007-05-22 09:16:00",6e-04,"mg/L","2007-05-20 21:16:00",12.6718645833333,0,-3.22184874961636,0.0244948974278318,-7.41858090274813 +"4",4,"2007-06-19 08:50:00",0.0014,"mg/L","2007-06-17 20:50:00",17.8052070833333,8.8,-2.85387196432176,0.0374165738677394,-6.57128304236092 +"5",5,"2007-07-16 09:03:00",0.0014,"mg/L","2007-07-14 21:03:00",16.1385427083333,0,-2.85387196432176,0.0374165738677394,-6.57128304236092 +"6",6,"2007-08-13 09:37:00",0.0023,"mg/L","2007-08-11 21:37:00",18.0302233333333,2.8,-2.63827216398241,0.0479583152331272,-6.07484615604703 +"7",7,"2007-09-17 10:14:00",0.001,"mg/L","2007-09-15 22:14:00",14.2031420833333,0,-3,0.0316227766016838,-6.90775527898214 +"8",8,"2007-10-22 09:23:00",0.0025,"mg/L","2007-10-20 21:23:00",12.602100625,0,-2.60205999132796,0.05,-5.99146454710798 +"9",9,"2008-05-21 09:01:00",5e-04,"mg/L","2008-05-19 21:01:00",10.4791666666666,0,-3.30102999566398,0.0223606797749979,-7.60090245954208 +"10",10,"2008-07-21 09:26:00",0.004,"mg/L","2008-07-19 21:26:00",17.81875,31.8,-2.39794000867204,0.0632455532033676,-5.52146091786225 +"11",11,"2008-08-12 09:15:00",0.0034,"mg/L","2008-08-10 21:15:00",15.1958333333333,0,-2.46852108295775,0.058309518948453,-5.68397984736002 +"12",12,"2008-09-15 09:15:00",0.0062,"mg/L","2008-09-13 21:15:00",14.7927048649647,24.6,-2.20760831050175,0.0787400787401181,-5.08320598693109 +"13",13,"2008-10-09 08:46:00",0.001,"mg/L","2008-10-07 20:46:00",10.0437361134257,12,-3,0.0316227766016838,-6.90775527898214 +"14",14,"2008-11-06 09:55:00",7e-04,"mg/L","2008-11-04 21:55:00",7.03645949433987,0.2,-3.15490195998574,0.0264575131106459,-7.26443022292087 +"15",15,"2009-03-18 09:20:00",0.0024,"mg/L","2009-03-16 21:20:00",2.71458333333333,0,-2.61978875828839,0.0489897948556636,-6.03228654162824 +"16",16,"2009-04-06 09:40:00",8e-04,"mg/L","2009-04-04 21:40:00",4.96145717977963,13.4,-3.09691001300806,0.0282842712474619,-7.13089883029635 +"17",17,"2009-05-05 09:35:00",0.0034,"mg/L","2009-05-03 21:35:00",10.5677118094093,6.4,-2.46852108295775,0.058309518948453,-5.68397984736002 +"18",18,"2009-06-15 10:00:00",0.0016,"mg/L","2009-06-13 22:00:00",14.1437546219225,0,-2.79588001734407,0.04,-6.4377516497364 +"19",19,"2009-07-14 09:40:00",0.0016,"mg/L","2009-07-12 21:40:00",16.5927187384391,0,-2.79588001734407,0.04,-6.4377516497364 +"20",20,"2009-08-10 10:10:00",0.0064,"mg/L","2009-08-08 22:10:00",16.5684181286549,29,-2.19382002601611,0.08,-5.05145728861651 +"21",21,"2009-09-14 09:00:00",0.0013,"mg/L","2009-09-12 21:00:00",15.5200148148147,0,-2.88605664769316,0.0360555127546399,-6.64539101451465 +"22",22,"2009-10-19 09:00:00",0.0026,"mg/L","2009-10-17 21:00:00",7.18541203703738,0,-2.58502665202918,0.0509901951359278,-5.9522438339547 +"23",23,"2009-11-23 08:55:00",0.0024,"mg/L","2009-11-21 20:55:00",6.76458333333333,0,-2.61978875828839,0.0489897948556636,-6.03228654162824 +"24",24,"2010-04-08 09:20:00",0.0038,"mg/L","2010-04-06 21:20:00",9.22083333333334,30.2,-2.42021640338319,0.0616441400296898,-5.5727542122498 +"25",25,"2010-04-19 09:15:00",0.0018,"mg/L","2010-04-17 21:15:00",9.12083333333333,0.2,-2.74472749489669,0.0424264068711929,-6.31996861408002 +"26",26,"2010-05-25 09:31:00",9e-04,"mg/L","2010-05-23 21:31:00",14.8197916666666,0,-3.04575749056068,0.03,-7.01311579463996 +"27",27,"2010-06-21 09:20:00",0.0063,"mg/L","2010-06-19 21:20:00",16.9104166666666,20,-2.20065945054642,0.0793725393319377,-5.06720564558465 +"28",28,"2010-07-19 09:20:00",0.0032,"mg/L","2010-07-17 21:20:00",18.93125,6,-2.49485002168009,0.0565685424949238,-5.74460446917646 +"29",29,"2010-08-16 09:40:00",0.0042,"mg/L","2010-08-14 21:40:00",18.8843645948948,0.4,-2.3767507096021,0.0648074069840786,-5.47267075369281 +"30",30,"2010-09-20 09:35:00",0.0028,"mg/L","2010-09-18 21:35:00",13.6072997595263,0.2,-2.55284196865778,0.0529150262212918,-5.87813586180098 +"31",31,"2010-10-26 09:40:00",0.0018,"mg/L","2010-10-24 21:40:00",9.69999999999999,11.8,-2.74472749489669,0.0424264068711929,-6.31996861408002 +"32",32,"2010-11-24 09:45:00",0.0028,"mg/L","2010-11-22 21:45:00",6.68510638297872,10.2,-2.55284196865778,0.0529150262212918,-5.87813586180098 +"33",33,"2011-03-11 16:25:00",0.0164,"mg/L","2011-03-10 04:25:00",1.35416666666665,37.2,-1.7851561519523,0.128062484748657,-4.11047394415198 +"34",34,"2011-04-11 09:45:00",0.0029,"mg/L","2011-04-09 21:45:00",4.83124999999999,6.2,-2.53760200210104,0.053851648071345,-5.84304454198971 +"35",35,"2011-05-17 09:35:00",0.0041,"mg/L","2011-05-15 21:35:00",11.0458333333333,7,-2.38721614328026,0.0640312423743285,-5.49676830527187 +"36",36,"2011-06-20 09:10:00",0.0028,"mg/L","2011-06-18 21:10:00",15.8458333333333,0,-2.55284196865778,0.0529150262212918,-5.87813586180098 +"37",37,"2011-07-18 09:40:00",0.0066,"mg/L","2011-07-16 21:40:00",17.6541666666666,0,-2.18045606445813,0.0812403840463596,-5.02068562994976 +"38",38,"2011-11-17 10:10:00",5e-04,"mg/L","2011-11-15 22:10:00",7.98541666666667,0,-3.30102999566398,0.0223606797749979,-7.60090245954208 +"39",39,"2012-04-16 09:10:00",0.0014,"mg/L","2012-04-14 21:10:00",8.08645833333318,4.6,-2.85387196432176,0.0374165738677394,-6.57128304236092 +"40",40,"2012-05-05 09:15:00",5e-04,"mg/L","2012-05-03 21:15:00",10.925,7.6,-3.30102999566398,0.0223606797749979,-7.60090245954208 +"41",41,"2012-06-18 09:00:00",0.0056,"mg/L","2012-06-16 21:00:00",17.6625,4.2,-2.2518119729938,0.0748331477354788,-5.18498868124103 +"42",42,"2012-07-16 09:00:00",0.008,"mg/L","2012-07-14 21:00:00",19.3739583333333,0,-2.09691001300806,0.0894427190999916,-4.8283137373023 +"43",43,"2012-08-13 09:00:00",0.006,"mg/L","2012-08-11 21:00:00",17.9444444444444,1.8,-2.22184874961636,0.0774596669241483,-5.11599580975408 +"44",44,"2012-09-12 09:20:00",0.0015,"mg/L","2012-09-10 21:20:00",15.8007740402899,0,-2.82390874094432,0.0387298334620742,-6.50229017087397 +"45",45,"2012-10-15 09:20:00",0.0022,"mg/L","2012-10-13 21:20:00",9.75624999999998,21.6,-2.65757731917779,0.0469041575982343,-6.11929791861787 +"46",46,"2012-11-13 09:15:00",0.005,"mg/L","2012-11-11 21:15:00",7.06666666666692,8.8,-2.30102999566398,0.0707106781186548,-5.29831736654804 +"47",47,"2013-04-18 09:10:00",0.0019,"mg/L","2013-04-16 21:10:00",5.94479166666661,7.8,-2.72124639904717,0.0435889894354067,-6.26590139280974 +"48",48,"2013-05-16 09:20:00",0.0064,"mg/L","2013-05-14 21:20:00",10.95,0.4,-2.19382002601611,0.08,-5.05145728861651 +"49",49,"2013-06-17 09:45:00",0.0029,"mg/L","2013-06-15 21:45:00",15.0499999999997,10.8,-2.53760200210104,0.053851648071345,-5.84304454198971 +"50",50,"2013-07-09 09:20:00",0.0062,"mg/L","2013-07-07 21:20:00",17.6520833333333,0.6,-2.20760831050175,0.0787400787401181,-5.08320598693109 +"51",51,"2013-08-13 09:30:00",0.0028,"mg/L","2013-08-11 21:30:00",15.9833333333333,2,-2.55284196865778,0.0529150262212918,-5.87813586180098 +"52",52,"2013-09-16 09:35:00",0.0036,"mg/L","2013-09-14 21:35:00",14.5572916666667,1.2,-2.44369749923271,0.06,-5.62682143352007 +"53",53,"2013-10-22 09:30:00",0.0042,"mg/L","2013-10-20 21:30:00",10.6666666666666,15.6,-2.3767507096021,0.0648074069840786,-5.47267075369281 +"54",54,"2014-04-08 14:30:00",0.0088,"mg/L","2014-04-07 02:30:00",2.46666550917913,15.4,-2.05551732784983,0.0938083151964686,-4.73300355749798 +"55",55,"2014-05-01 11:50:00",0.0026,"mg/L","2014-04-29 23:50:00",7.12291666666674,14,-2.58502665202918,0.0509901951359278,-5.9522438339547 +"56",56,"2016-09-19 09:20:00",0.0036,"mg/L","2016-09-17 21:20:00",15.9333334166667,0,-2.44369749923271,0.06,-5.62682143352007 +"57",57,"2016-11-28 09:30:00",0.0036,"mg/L","2016-11-26 21:30:00",4.9250000000001,1.6,-2.44369749923271,0.06,-5.62682143352007 +"58",58,"2017-04-25 10:10:00",0.0032,"mg/L","2017-04-23 22:10:00",9.125,14.4,-2.49485002168009,0.0565685424949238,-5.74460446917646 +"59",59,"2017-05-15 09:30:00",0.0036,"mg/L","2017-05-13 21:30:00",10.5489583333333,0,-2.44369749923271,0.06,-5.62682143352007 +"60",60,"2017-06-15 09:35:00",0.0041,"mg/L","2017-06-13 21:35:00",16.5885416562499,0.2,-2.38721614328026,0.0640312423743285,-5.49676830527187 +"61",61,"2017-07-24 09:50:00",0.0036,"mg/L","2017-07-22 21:50:00",17.4499998020833,1,-2.44369749923271,0.06,-5.62682143352007 +"62",62,"2017-08-31 09:35:00",0.0035,"mg/L","2017-08-29 21:35:00",15.5958333333333,0.4,-2.45593195564972,0.0591607978309962,-5.65499231048677 +"63",63,"2017-09-20 09:40:00",0.0024,"mg/L","2017-09-18 21:40:00",15.8458333541667,1,-2.61978875828839,0.0489897948556636,-6.03228654162824 +"64",64,"2017-10-18 09:30:00",0.0062,"mg/L","2017-10-16 21:30:00",11.7052083333334,0,-2.20760831050175,0.0787400787401181,-5.08320598693109 +"65",65,"2017-11-06 09:10:00",0.0076,"mg/L","2017-11-04 21:10:00",8.25520833333336,0,-2.11918640771921,0.0871779788708135,-4.87960703168985 +"66",66,"2018-04-09 09:50:00",0,"mg/L","2018-04-07 21:50:00",1.3,0,0,0,0 +"67",67,"2018-05-14 09:40:00",0,"mg/L","2018-05-12 21:40:00",10.8875,0,0,0,0 +"68",68,"2018-06-19 09:40:00",0,"mg/L","2018-06-17 21:40:00",16.5937497916667,3.2,0,0,0 +"69",69,"2018-07-23 08:45:00",0,"mg/L","2018-07-21 20:45:00",17.6875,13.6,0,0,0 +"70",70,"2018-08-27 09:15:00",0.03,"mg/L","2018-08-25 21:15:00",17.597916375,16,-1.52287874528034,0.173205080756888,-3.50655789731998 +"71",71,"2018-09-10 10:10:00",0,"mg/L","2018-09-08 22:10:00",16.3145835208333,17,0,0,0 +"72",72,"2018-10-22 09:30:00",0,"mg/L","2018-10-20 21:30:00",8.65697569444405,0,0,0,0 +"73",73,"2018-11-27 09:25:00",0,"mg/L","2018-11-25 21:25:00",2.59166666666667,44.8,0,0,0 +"74",74,"2019-04-10 09:25:00",0.0032,"mg/L","2019-04-08 21:25:00",3.725,0,-2.49485002168009,0.0565685424949238,-5.74460446917646 diff --git a/data/water_temp/ABF_raw_water_temp.xlsx b/data/water_temp/ABF_raw_water_temp.xlsx new file mode 100644 index 0000000..79d553e Binary files /dev/null and b/data/water_temp/ABF_raw_water_temp.xlsx differ diff --git a/data/water_temp/ABF_summarized_water_temp.csv b/data/water_temp/ABF_summarized_water_temp.csv new file mode 100644 index 0000000..6b26051 --- /dev/null +++ b/data/water_temp/ABF_summarized_water_temp.csv @@ -0,0 +1,203 @@ +"","Year","Month","Minimum","Maximum","Average","Num_Samples" +"1",2002,10,1.4,13.5,6.909375,480 +"2",2002,11,0.6,9.9,3.625,648 +"3",2002,12,0.6,2.8,1.0328,125 +"4",2003,1,0.6,1.8,0.921621621621622,37 +"5",2003,3,0.6,5.2,2.47556390977444,266 +"6",2003,4,0.6,16.4,6.97990115321252,607 +"7",2003,5,8.1,18.8,12.3306451612903,744 +"8",2003,6,10.5,26.3,17.3354166666667,720 +"9",2003,7,15,25.6,19.4139784946237,744 +"10",2003,8,13.8,24.9,19.9266759776536,716 +"11",2003,9,9.1,20.6,15.69,720 +"12",2003,10,4.2,15.4,8.50152777777778,720 +"13",2003,11,1,10.3,4.81861111111111,720 +"14",2003,12,0.6,3.3,1.55386138613861,505 +"15",2004,1,0.7,4.8,2.54150943396226,53 +"16",2004,2,0.6,1.7,1.13333333333333,9 +"17",2004,3,0.6,6.1,2.22802547770701,471 +"18",2004,4,0.7,14.3,7.56981919332406,719 +"19",2004,5,6.5,21.4,13.9393817204301,744 +"20",2004,6,12,23.2,17.0450847457627,590 +"21",2004,7,15.3,24.2,19.1440366972477,654 +"22",2004,8,12.4,23.8,17.8844086021505,744 +"23",2004,9,10.8,21.9,16.5743055555556,720 +"24",2004,10,6.2,14.9,9.65040322580645,744 +"25",2004,11,0.6,9.6,4.76,720 +"26",2004,12,0.6,3.7,1.85944055944056,286 +"27",2005,1,0.6,1,0.73030303030303,66 +"28",2005,2,0.6,1.2,0.892307692307692,13 +"29",2005,3,0.6,5.4,2.18477011494253,348 +"30",2005,4,0.6,15.3,7.01098591549296,710 +"31",2005,5,5.3,19.7,12.2006720430108,744 +"32",2005,6,13.3,26.6,20.0539748953975,717 +"33",2005,7,15.4,26.7,21.1927419354839,744 +"34",2005,8,15.1,25.6,19.8388663967611,741 +"35",2005,9,11.3,21,17.1051388888889,720 +"36",2005,10,3.5,18.8,10.5126388888889,720 +"37",2005,11,0.6,10.7,5.54721753794266,593 +"38",2005,12,0.6,3,1.2875,176 +"39",2006,1,0.6,13.1,5.21840411840412,777 +"40",2006,2,0.6,2.6,1.31056603773585,265 +"41",2006,3,0.6,9.3,2.68041044776119,536 +"42",2006,4,2.5,16.8,8.91625,720 +"43",2006,5,7.7,24.6,13.9639784946237,744 +"44",2006,6,12.8,23.8,18.2776388888889,720 +"45",2006,7,15.3,26.8,20.9838888888889,720 +"46",2006,8,14.2,27.7,19.2169582772544,743 +"47",2006,9,9.9,19,14.7345833333333,720 +"48",2006,10,3.5,15.1,8.72577597840756,741 +"49",2006,11,1.9,9,5.02398190045249,663 +"50",2006,12,0.6,7.9,2.59616368286445,391 +"51",2007,1,0.6,5.6,2.42064516129032,310 +"52",2007,3,0.6,5.4,2.33204419889503,362 +"53",2007,4,0.6,14.7,4.53170731707317,533 +"54",2007,5,8.6,21.7,14.5780913978495,744 +"55",2007,6,12.9,25,19.0555555555556,720 +"56",2007,7,13.4,24.2,18.5190860215054,744 +"57",2007,8,13.4,25.2,18.9887931034483,696 +"58",2007,9,9.2,22.2,16.0963888888889,720 +"59",2007,10,5,19.9,12.4834677419355,744 +"60",2007,11,0.6,9.4,4.0251953125,512 +"61",2007,12,0.6,1.4,0.842857142857143,217 +"62",2008,1,0.6,3.5,1.54186046511628,258 +"63",2008,2,0.6,1.2,0.804761904761905,63 +"64",2008,3,0.6,4.1,1.61002949852507,339 +"65",2008,4,0.6,17.4,7.81980474198047,717 +"66",2008,5,6.7,18.7,12.2918010752688,744 +"67",2008,6,12.2,25,18.3038888888889,720 +"68",2008,7,16.5,24.4,20.3318548387097,744 +"69",2008,8,15.1,22.4,18.5486559139785,744 +"70",2008,9,13.2,21.3,16.5137353433836,597 +"71",2008,10,2.3,15,9.20631720430108,744 +"72",2008,11,0.6,9.7,4.22324561403509,684 +"73",2008,12,0.6,1.9,1.28368794326241,141 +"74",2009,2,0.6,1,0.753191489361702,47 +"75",2009,3,0.6,7.7,3.04835924006908,579 +"76",2009,4,2.3,15.2,8.11717902350814,553 +"77",2009,5,8.8,19.4,13.6851444291609,727 +"78",2009,6,12.1,23.2,16.6201267828843,631 +"79",2009,7,14.9,20.9,17.8366515837104,663 +"80",2009,8,14.1,22.5,18.8421474358974,624 +"81",2009,9,11,19.7,15.8504347826087,575 +"82",2009,10,3.5,11.1,8.31419624217119,479 +"83",2009,11,2.4,9.1,5.74192825112108,446 +"84",2009,12,0.9,4.6,2.66214285714286,140 +"85",2010,3,0.6,8.9,2.67079207920792,404 +"86",2010,4,0.6,14.4,9.19628008752735,457 +"87",2010,5,6.7,23.3,14.3664473684211,456 +"88",2010,6,14,22.4,18.5780160857909,373 +"89",2010,7,14.6,24.3,20.1610215053763,372 +"90",2010,8,14.1,23.8,19.7459962756052,537 +"91",2010,9,10.9,22.6,14.9805825242718,515 +"92",2010,10,6,13.9,9.34827586206896,348 +"93",2010,11,0.7,7.6,4.53317191283293,413 +"94",2010,12,0.6,4.3,1.32585034013605,147 +"95",2011,1,0.6,2,1.43095238095238,42 +"96",2011,3,0.6,5.2,1.63508771929825,342 +"97",2011,4,0.6,11.4,5.79802130898021,657 +"98",2011,5,0.6,21.3,11.7694444444444,612 +"99",2011,6,14,22.5,18.01056,625 +"100",2011,7,16.1,26.7,21.0674479166667,384 +"101",2011,8,15.4,24.4,19.625,504 +"102",2011,9,10.6,22.2,15.9438775510204,588 +"103",2011,10,0.6,15.8,9.44230769230769,312 +"104",2011,11,0.6,0.9,0.822857142857143,35 +"105",2011,12,0.6,4.1,1.39233644859813,535 +"106",2012,1,0.6,2.4,1.30839416058394,274 +"107",2012,2,0.6,3,1.34547206165703,519 +"108",2012,3,0.6,15.9,6.33865300146413,683 +"109",2012,4,3.8,15.7,7.80681502086231,719 +"110",2012,5,7.1,23,15.5286290322581,744 +"111",2012,6,12.4,25.4,18.1920723226704,719 +"112",2012,7,15.6,25.9,20.5721774193548,744 +"113",2012,8,13.8,25,18.821130551817,743 +"114",2012,9,9.4,20.3,14.7690277777778,720 +"115",2012,10,4.1,15.5,9.56339165545088,743 +"116",2012,11,0.6,8.4,3.80569800569801,702 +"117",2012,12,0.6,6.5,2.48696537678208,491 +"118",2013,1,0.6,4.1,1.53474178403756,213 +"119",2013,2,0.6,1.3,0.847826086956522,23 +"120",2013,3,0.6,5.4,1.88982683982684,462 +"121",2013,4,0.6,12.2,5.63958333333333,720 +"122",2013,5,7.3,21.1,14.4095430107527,744 +"123",2013,6,13,24.2,17.9738525730181,719 +"124",2013,7,15.7,26.6,20.4735215053763,744 +"125",2013,8,13.9,22.4,18.5425876010782,742 +"126",2013,9,10.9,22,15.5602777777778,720 +"127",2013,10,4,17.4,10.777688172043,744 +"128",2013,11,0.6,9.7,4.11018062397373,609 +"129",2013,12,0.6,4.2,1.73260869565217,184 +"130",2014,1,0.6,0.6,0.6,4 +"131",2014,3,0.6,3.6,1.12900763358779,131 +"132",2014,4,0.6,11.5,5.26161473087819,706 +"133",2014,5,6.1,20.5,13.2858503401361,735 +"134",2014,6,14.4,23.9,18.6301808066759,719 +"135",2014,7,14.7,23.5,18.7682795698925,744 +"136",2014,8,14.4,21.9,18.1551724137931,725 +"137",2014,9,11.3,22.1,15.825,720 +"138",2014,10,5.8,15.8,10.3651413189771,743 +"139",2014,11,0.6,7.3,3.52073170731707,574 +"140",2014,12,0.6,4.2,1.8,514 +"141",2015,3,0.6,4.5,1.88759398496241,266 +"142",2015,4,1.2,14,6.28817802503477,719 +"143",2015,5,8.6,21.7,15.0364296081277,689 +"144",2016,6,14.5,23.8,18.7361271676301,346 +"145",2016,7,14.3,25.5,20.1397849462366,744 +"146",2016,8,16.2,24.9,20.7018817204301,744 +"147",2016,9,11.4,23.2,16.9805555555556,720 +"148",2016,10,3.7,16.9,11.0173387096774,744 +"149",2016,11,0.6,10.5,5.41690751445087,692 +"150",2016,12,0.6,6,2.56051502145923,233 +"151",2017,1,0.6,2.4,1.35810397553517,327 +"152",2017,2,0.6,4.8,1.97109634551495,301 +"153",2017,3,0.6,8.1,2.99455909943715,533 +"154",2017,4,2,15.8,8.76555555555556,720 +"155",2017,5,5.8,20.9,12.1036290322581,744 +"156",2017,6,12.6,22.6,17.7080555555556,720 +"157",2017,7,16.4,22.8,19.3258064516129,744 +"158",2017,8,13.5,22.1,18.2284946236559,744 +"159",2017,9,10.6,21.9,16.2089012517385,719 +"160",2017,10,5.6,17.3,11.648710990502,737 +"161",2017,11,0.6,8.2,3.81027104136947,701 +"162",2017,12,0.6,5.1,2.48457142857143,175 +"163",2018,2,0.6,4.3,1.58872180451128,133 +"164",2018,3,0.6,5.6,2.15592705167173,658 +"165",2018,4,0.7,10.7,4.34634146341463,615 +"166",2018,5,8,23.8,15.4727150537634,744 +"167",2018,6,13.3,25.8,18.1066666666667,720 +"168",2018,7,16.4,26.7,20.6370967741935,744 +"169",2018,8,16.2,24.3,20.4346774193548,744 +"170",2018,9,11.5,24.1,17.08125,720 +"171",2018,10,3.2,17.2,8.8010752688172,744 +"172",2018,11,0.6,7.8,3.06232339089482,637 +"173",2018,12,0.6,3.2,1.44489795918367,539 +"174",2019,1,0.6,2.2,1.25034965034965,143 +"175",2019,2,0.6,0.7,0.672727272727273,22 +"176",2019,3,0.6,5.9,2.08662420382166,314 +"177",2019,4,0.6,10,5.50240793201133,706 +"178",2019,5,5.4,17.7,11.3244623655914,744 +"179",2019,6,12.2,22.8,17.0993055555556,720 +"180",2019,7,17.2,25,20.9412634408602,744 +"181",2019,8,14.7,22.9,19.0041666666667,744 +"182",2019,9,12.4,20.3,15.8594444444444,720 +"183",2019,10,5.6,17.4,10.6737931034483,580 +"184",2022,6,13,23.8,18.4533527696793,343 +"185",2022,7,15.1,23.2,19.059811827957,744 +"186",2022,8,14.7,24.1,19.2802968960864,741 +"187",2022,9,9.3,20.9,15.9126388888889,720 +"188",2022,10,5,14,9.32768817204301,744 +"189",2022,11,0,13.5,5.37042253521127,710 +"190",2022,12,0,4.6,1.36101949025487,667 +"191",2023,1,0,3.1,1.48134110787172,686 +"192",2023,2,0,4.5,1.0954465849387,571 +"193",2023,3,0,4.7,1.98917808219178,730 +"194",2023,4,1.1,18.6,8.805,720 +"195",2023,5,6.7,21.3,13.4608870967742,744 +"196",2023,6,13.7,21.9,17.8477777777778,720 +"197",2023,7,17.5,24.2,20.3994623655914,744 +"198",2023,8,14.4,21.1,18.5280913978495,744 +"199",2023,9,12.4,21.9,16.4368055555556,720 +"200",2023,10,6.4,17.8,11.832123655914,744 +"201",2023,11,0.3,8.4,4.45513888888889,720 +"202",2023,12,0.4,6.4,3.22081081081081,740 diff --git a/data/water_temp/ABF_water_temp_metadata.xlsx b/data/water_temp/ABF_water_temp_metadata.xlsx new file mode 100644 index 0000000..9e86f71 Binary files /dev/null and b/data/water_temp/ABF_water_temp_metadata.xlsx differ diff --git a/data/water_temp/SR10_raw_water_temp.xlsx b/data/water_temp/SR10_raw_water_temp.xlsx new file mode 100644 index 0000000..2d763bf Binary files /dev/null and b/data/water_temp/SR10_raw_water_temp.xlsx differ diff --git a/data/water_temp/SR10_summarized_water_temp.csv b/data/water_temp/SR10_summarized_water_temp.csv new file mode 100644 index 0000000..70d3d27 --- /dev/null +++ b/data/water_temp/SR10_summarized_water_temp.csv @@ -0,0 +1,224 @@ +"","Year","Month","Minimum","Maximum","Average","Num_Samples" +"1",1999,8,13,15.3,14.4042553191489,47 +"2",1999,9,10.1,15.3,13.6810276679842,506 +"3",1999,10,6.3,13.4,10.1775537634409,744 +"4",1999,11,2.6,10.1,7.405,720 +"5",1999,12,0,7.7,4.68275862068965,638 +"6",2000,1,0,4.6,2.13174224343675,419 +"7",2000,2,0,4.9,3.37256371814093,667 +"8",2000,3,0,4.9,2.64010989010989,728 +"9",2000,4,0,5.4,3.47774687065369,719 +"10",2000,5,4.1,9.5,7.36787634408602,744 +"11",2000,6,8.7,11.9,10.3461322081575,711 +"12",2000,7,11.6,13.5,12.7457374830853,739 +"13",2000,8,11.8,14.3,13.3515358361775,293 +"14",2001,3,1,3.4,1.91651651651652,666 +"15",2001,4,3,11.8,6.81265646731572,719 +"16",2001,5,10.4,16.8,13.4674731182796,744 +"17",2001,6,11.6,22,16.8288888888889,720 +"18",2001,7,16.1,22.3,18.9777934936351,707 +"19",2001,8,16.9,23.2,19.4690444145357,743 +"20",2001,9,11.4,19.3,15.6651388888889,720 +"21",2001,10,7.1,14.2,10.6240915208614,743 +"22",2001,11,5.4,9.7,7.41277777777778,720 +"23",2001,12,1.4,7.4,4.43428143712575,668 +"24",2002,1,1.1,2.9,1.58544303797468,158 +"25",2002,2,1,3,1.59441117764471,501 +"26",2002,3,1.3,4.4,2.61922043010753,744 +"27",2002,4,3,13.1,6.97402777777778,720 +"28",2002,5,7.1,15.8,9.72987886944818,743 +"29",2002,6,12.1,19.6,15.9197496522949,719 +"30",2002,7,16.4,21.3,18.7700268817204,744 +"31",2002,8,15.6,20.3,17.6478494623656,744 +"32",2002,9,13.1,17.4,15.8095966620306,719 +"33",2002,10,5.5,15.5,10.6208446866485,734 +"34",2002,11,3,8.4,5.52743732590529,718 +"35",2002,12,1.1,3.3,1.57304582210243,742 +"36",2003,1,0.6,1.8,1.18924731182796,744 +"37",2003,2,0.3,0.7,0.561019490254873,667 +"38",2003,3,0.3,2.9,0.848046309696093,691 +"39",2003,4,1,8.8,4.06173184357542,716 +"40",2003,5,7.5,12.6,9.99260752688172,744 +"41",2003,6,11,17.9,14.1934540389972,718 +"42",2003,7,15.6,18.5,16.7793800539084,742 +"43",2003,8,15.7,18.3,17.1305555555556,720 +"44",2003,9,11.8,16.3,14.8769874476987,717 +"45",2003,10,7.4,11.8,9.47398921832884,742 +"46",2003,11,4.2,9.1,6.47057182705718,717 +"47",2003,12,2.2,4.3,2.73333333333333,744 +"48",2004,1,1.1,3.9,1.73064516129032,744 +"49",2004,2,1,1.6,1.17686781609195,696 +"50",2004,3,1.2,4.6,2.10922659430122,737 +"51",2004,4,3.9,9.6,6.44297635605007,719 +"52",2004,5,8.5,14.8,11.8254032258065,744 +"53",2004,6,11.9,16.5,14.5643055555556,720 +"54",2004,7,14.7,18.8,16.851747311828,744 +"55",2004,8,14.1,17.9,15.9504178272981,718 +"56",2004,9,12.9,17.3,15.2326388888889,720 +"57",2004,10,9,13.4,10.385752688172,744 +"58",2004,11,4.5,10.1,6.7105702364395,719 +"59",2004,12,1.5,5.1,2.97768817204301,744 +"60",2005,1,1.2,2.3,1.63212365591398,744 +"61",2005,2,1.1,1.4,1.21354166666667,672 +"62",2005,3,1.1,2.8,1.48977119784657,743 +"63",2005,4,1.9,9.1,5.73756983240223,716 +"64",2005,5,6.5,14.3,10.3837365591398,744 +"65",2005,6,13.5,20.6,17.9011111111111,720 +"66",2005,7,16.8,20.7,18.7166416791604,667 +"67",2005,8,15.6,19.1,17.5185286103542,734 +"68",2005,9,13.5,17.2,15.8005555555556,720 +"69",2005,10,7,15,11.3879032258065,744 +"70",2005,11,3.1,9.3,6.68172942817294,717 +"71",2005,12,1.8,5.1,2.46061827956989,744 +"72",2006,1,1.6,3.3,2.30510752688172,744 +"73",2006,2,1.1,2.8,1.81696428571429,672 +"74",2006,3,0.9,5.3,2.12099596231494,743 +"75",2006,4,4.8,11,7.78986111111111,720 +"76",2006,5,9.4,17.2,11.9817204301075,744 +"77",2006,6,15.1,19,16.9998611111111,720 +"78",2006,7,16.9,19.6,18.2434301521438,723 +"79",2006,8,15.8,20.7,17.4321668909825,743 +"80",2006,9,12,16.2,14.6297222222222,720 +"81",2006,10,6.6,13.1,10.0161290322581,744 +"82",2006,11,4.4,7.4,6.17051460361613,719 +"83",2006,12,2.7,7.4,4.04475806451613,744 +"84",2007,1,1.7,5.1,2.82069892473118,744 +"85",2007,2,1.1,1.7,1.36476868327402,562 +"86",2007,3,1.2,4.4,1.95094339622642,742 +"87",2007,4,2.8,10,5.57777777777778,720 +"88",2007,5,9.1,16.1,12.6333333333333,693 +"89",2007,6,14.6,18.5,16.8381944444444,720 +"90",2007,7,15.3,18.3,16.7782258064516,744 +"91",2007,8,15.5,19.5,17.6600269179004,743 +"92",2007,9,13.2,18.1,15.7581944444444,720 +"93",2007,10,9.3,16.1,13.0165745856354,724 +"94",2007,11,3.3,9.8,6.05340751043115,719 +"95",2007,12,2.1,3.3,2.43908355795148,742 +"96",2008,1,0.9,3.1,2.05094086021505,744 +"97",2008,2,1,1.4,1.18045977011494,696 +"98",2008,3,1,2.7,1.50833333333333,744 +"99",2008,4,1.7,12,6.51388888888889,720 +"100",2008,5,8.5,14.5,11.1681451612903,744 +"101",2008,6,12.7,18.8,16.1086111111111,720 +"102",2008,7,15.8,18.2,16.9693548387097,744 +"103",2008,8,14.2,16.9,15.5190860215054,744 +"104",2008,9,12.2,16,13.9794251134644,661 +"105",2008,10,6.1,13.4,9.5247311827957,744 +"106",2008,11,3.1,7.9,5.55625,720 +"107",2008,12,1.5,3.4,2.34623655913978,744 +"108",2009,1,1.3,1.7,1.5010752688172,744 +"109",2009,2,1,1.5,1.21056547619048,672 +"110",2009,3,1,5,2.51034946236559,744 +"111",2009,4,3.6,10.6,6.34464534075104,719 +"112",2009,5,10.1,14.6,11.8679245283019,742 +"113",2009,6,12.1,18.5,14.8541666666667,720 +"114",2009,7,15.5,17.6,16.4102749638206,691 +"115",2009,8,15.2,19.3,17.1921052631579,646 +"116",2009,9,13.2,16.7,15.1993026499303,717 +"117",2009,10,6.6,13.5,9.66643741403026,727 +"118",2009,11,5.5,10,6.93602941176471,680 +"119",2009,12,1.8,5.7,3.00537634408602,744 +"120",2010,1,1.2,1.9,1.49717741935484,744 +"121",2010,2,0.9,1.2,1.00119047619048,672 +"122",2010,3,1,5.4,2.73185483870968,744 +"123",2010,4,5.6,11.1,9.12694444444444,720 +"124",2010,5,9,18.1,13.059097127223,731 +"125",2010,6,14.2,18.4,16.4386111111111,720 +"126",2010,7,14.9,19.8,18.069623655914,744 +"127",2010,8,15.4,19.2,17.4106182795699,744 +"128",2010,9,13,18.4,14.9240559440559,715 +"129",2010,10,8.4,13.2,10.5207267833109,743 +"130",2010,11,4,9.1,6.19443671766342,719 +"131",2010,12,1.4,4.9,2.35021037868163,713 +"132",2011,1,1.2,1.8,1.45120967741935,744 +"133",2011,2,0.9,1.3,1.13735119047619,672 +"134",2011,3,0.9,2.8,1.67405913978495,744 +"135",2011,4,2.5,8.1,5.25972222222222,720 +"136",2011,5,7.5,14.9,11.0540322580645,744 +"137",2011,6,14.1,16.9,15.47,720 +"138",2011,7,15.2,20.3,17.9168010752688,744 +"139",2011,8,15.8,19.4,17.5697580645161,744 +"140",2011,9,13,17.7,15.1225,720 +"141",2011,10,7.4,14.3,11.2329301075269,744 +"142",2011,11,5.4,8.4,7.00458333333333,720 +"143",2011,12,2.5,6.4,3.89354838709677,744 +"144",2012,1,1.5,2.9,2.1343203230148,743 +"145",2012,2,1.5,2.4,1.81293103448276,696 +"146",2012,3,1.7,10.3,5.25672043010753,744 +"147",2012,4,6.1,10.6,7.71777777777778,720 +"148",2012,5,7.5,17.6,13.2975806451613,744 +"149",2012,6,13.6,20.4,17.0361111111111,720 +"150",2012,7,18.3,20.7,19.4005376344086,744 +"151",2012,8,16,20.2,18.5374358974359,390 +"152",2012,9,12.1,18.1,14.9933121019108,628 +"153",2012,10,8.4,13.8,10.884811827957,744 +"154",2012,11,3.9,8.7,6.18888888888889,720 +"155",2012,12,2.4,5.7,3.7866935483871,744 +"156",2013,1,1.2,3.8,2.20591397849462,744 +"157",2013,2,1.2,1.5,1.28645833333333,672 +"158",2013,3,1.4,3.6,1.95967741935484,744 +"159",2013,4,2.8,8.8,5.36041666666667,720 +"160",2013,5,9,15.8,12.780376344086,744 +"161",2013,6,13.3,17.8,15.3302777777778,720 +"162",2013,7,15.5,20.5,17.578331090175,743 +"163",2013,8,14.5,17.7,16.1481830417227,743 +"164",2013,9,12.1,18.1,14.7716666666667,720 +"165",2013,10,7.1,14.5,11.4353494623656,744 +"166",2013,11,2.7,9.1,5.91361111111111,720 +"167",2013,12,1.7,3.7,2.25712365591398,744 +"168",2014,1,1.1,1.9,1.45174731182796,744 +"169",2014,2,0.9,1.3,1.13720238095238,672 +"170",2014,3,0.9,1.9,1.23840970350404,742 +"171",2014,4,1.5,8.8,5.01236111111111,720 +"172",2014,5,7,16,11.5006451612903,620 +"173",2016,9,13.1,18.6,16.0207246376812,690 +"174",2016,10,7.5,14.8,11.7331989247312,744 +"175",2016,11,3.9,9.9,6.76486111111111,720 +"176",2016,12,1.8,6,2.9991935483871,744 +"177",2017,1,1,2.7,1.75684931506849,730 +"178",2017,2,0.9,3.2,1.62142857142857,672 +"179",2017,3,0.9,5.3,2.5364247311828,744 +"180",2017,4,3.8,12.1,7.81277777777778,720 +"181",2017,5,7.7,15,11.1263440860215,744 +"182",2017,6,13.3,17.7,15.5919444444444,720 +"183",2017,7,15.6,17.8,16.8934139784946,744 +"184",2017,8,14.5,17.8,16.5201079622132,741 +"185",2017,9,12.5,17.7,15.0961057023644,719 +"186",2017,10,8.6,15,12.3680107526882,744 +"187",2017,11,3.8,9,5.57513888888889,720 +"188",2017,12,0.8,4.4,1.97415881561238,743 +"189",2018,1,0,0.8,0.356833558863329,739 +"190",2018,2,0,0.5,0.281538461538462,650 +"191",2018,3,0.5,2.2,0.878897849462366,744 +"192",2018,4,1.1,6.7,2.78430555555556,720 +"193",2018,5,6,17.7,12.2385752688172,744 +"194",2018,6,14,18,15.6879166666667,720 +"195",2018,7,16.7,19,17.8548387096774,744 +"196",2018,8,17,19.1,18.1384408602151,744 +"197",2018,9,13.2,19.1,16.4504166666667,720 +"198",2018,10,6.2,14.5,10.3612903225806,744 +"199",2018,11,2.2,7.7,4.64777777777778,720 +"200",2018,12,1.4,3.5,2.01720430107527,744 +"201",2019,1,0.3,1.7,0.895161290322581,744 +"202",2019,2,0,0.4,0.0955357142857143,672 +"203",2019,3,0,4.1,0.173049645390071,705 +"204",2019,4,0.5,7.5,4.03976083707025,669 +"205",2022,6,12,24.5,16.8861581920904,708 +"206",2022,7,14.5,23.5,18.7377688172043,744 +"207",2022,8,14.2,23.7,18.4790322580645,744 +"208",2022,9,8.3,20.5,15.14,720 +"209",2022,10,4.1,13.6,8.95900537634409,744 +"210",2022,11,0,13.4,5.27734487734488,693 +"211",2022,12,0,5.6,1.81726618705036,556 +"212",2023,1,0,3.5,1.69782244556114,597 +"213",2023,2,0,4.5,1.2525462962963,432 +"214",2023,3,0,5.8,2.09123783031989,719 +"215",2023,4,1.1,18.2,8.43597222222222,720 +"216",2023,5,6.1,22,12.8864247311828,744 +"217",2023,6,12,22.2,16.9925,720 +"218",2023,7,16.2,23.4,18.9969086021505,744 +"219",2023,8,13.3,21.2,17.6201612903226,744 +"220",2023,9,11.3,21.5,15.6843055555556,720 +"221",2023,10,0,17.6,11.9630036630037,546 +"222",2023,11,0,8.5,4.45178826895565,699 +"223",2023,12,0.4,6.7,3.34310810810811,740 diff --git a/data/water_temp/SR10_water_temp_metadata.xlsx b/data/water_temp/SR10_water_temp_metadata.xlsx new file mode 100644 index 0000000..69100e1 Binary files /dev/null and b/data/water_temp/SR10_water_temp_metadata.xlsx differ diff --git a/figures/STREAM/stream_classes.png b/figures/STREAM/stream_classes.png new file mode 100644 index 0000000..b1db5ec Binary files /dev/null and b/figures/STREAM/stream_classes.png differ diff --git a/figures/STREAM/stream_insect_families.png b/figures/STREAM/stream_insect_families.png new file mode 100644 index 0000000..fa50f12 Binary files /dev/null and b/figures/STREAM/stream_insect_families.png differ diff --git a/figures/STREAM/stream_phyla.png b/figures/STREAM/stream_phyla.png new file mode 100644 index 0000000..4aab469 Binary files /dev/null and b/figures/STREAM/stream_phyla.png differ diff --git a/figures/biotic_inventory/classes.png b/figures/biotic_inventory/classes.png new file mode 100644 index 0000000..bcf3cf1 Binary files /dev/null and b/figures/biotic_inventory/classes.png differ diff --git a/figures/biotic_inventory/domains.png b/figures/biotic_inventory/domains.png new file mode 100644 index 0000000..3455982 Binary files /dev/null and b/figures/biotic_inventory/domains.png differ diff --git a/figures/biotic_inventory/fish_families.png b/figures/biotic_inventory/fish_families.png new file mode 100644 index 0000000..38766bd Binary files /dev/null and b/figures/biotic_inventory/fish_families.png differ diff --git a/figures/biotic_inventory/fish_orders.png b/figures/biotic_inventory/fish_orders.png new file mode 100644 index 0000000..9eea4d1 Binary files /dev/null and b/figures/biotic_inventory/fish_orders.png differ diff --git a/figures/biotic_inventory/kingdoms.png b/figures/biotic_inventory/kingdoms.png new file mode 100644 index 0000000..1a78cf1 Binary files /dev/null and b/figures/biotic_inventory/kingdoms.png differ diff --git a/figures/biotic_inventory/phyla.png b/figures/biotic_inventory/phyla.png new file mode 100644 index 0000000..d7df7ea Binary files /dev/null and b/figures/biotic_inventory/phyla.png differ diff --git a/figures/historical_jul_aug_water_temp.png b/figures/historical_jul_aug_water_temp.png new file mode 100644 index 0000000..02dc44a Binary files /dev/null and b/figures/historical_jul_aug_water_temp.png differ diff --git a/figures/mann-kendall/MK_annual_air_temp.png b/figures/mann-kendall/MK_annual_air_temp.png new file mode 100644 index 0000000..f77ac86 Binary files /dev/null and b/figures/mann-kendall/MK_annual_air_temp.png differ diff --git a/figures/mann-kendall/MK_annual_flashiness.png b/figures/mann-kendall/MK_annual_flashiness.png new file mode 100644 index 0000000..03342aa Binary files /dev/null and b/figures/mann-kendall/MK_annual_flashiness.png differ diff --git a/figures/mann-kendall/MK_annual_flow.png b/figures/mann-kendall/MK_annual_flow.png new file mode 100644 index 0000000..68b5831 Binary files /dev/null and b/figures/mann-kendall/MK_annual_flow.png differ diff --git a/figures/mann-kendall/MK_annual_precip.png b/figures/mann-kendall/MK_annual_precip.png new file mode 100644 index 0000000..2acbc95 Binary files /dev/null and b/figures/mann-kendall/MK_annual_precip.png differ diff --git a/figures/mann-kendall/MK_annual_water_temp.png b/figures/mann-kendall/MK_annual_water_temp.png new file mode 100644 index 0000000..1f53257 Binary files /dev/null and b/figures/mann-kendall/MK_annual_water_temp.png differ diff --git a/figures/mann-kendall/MK_january_air_temp.png b/figures/mann-kendall/MK_january_air_temp.png new file mode 100644 index 0000000..154f676 Binary files /dev/null and b/figures/mann-kendall/MK_january_air_temp.png differ diff --git a/figures/mann-kendall/MK_july_air_temp.png b/figures/mann-kendall/MK_july_air_temp.png new file mode 100644 index 0000000..e0add1e Binary files /dev/null and b/figures/mann-kendall/MK_july_air_temp.png differ diff --git a/figures/most_extreme_values/ABF_high_temp.png b/figures/most_extreme_values/ABF_high_temp.png new file mode 100644 index 0000000..0d49618 Binary files /dev/null and b/figures/most_extreme_values/ABF_high_temp.png differ diff --git a/figures/most_extreme_values/ABF_low_temp.png b/figures/most_extreme_values/ABF_low_temp.png new file mode 100644 index 0000000..0299057 Binary files /dev/null and b/figures/most_extreme_values/ABF_low_temp.png differ diff --git a/figures/most_extreme_values/SR10_high_temp.png b/figures/most_extreme_values/SR10_high_temp.png new file mode 100644 index 0000000..c86cdb3 Binary files /dev/null and b/figures/most_extreme_values/SR10_high_temp.png differ diff --git a/figures/most_extreme_values/SR10_low_temp.png b/figures/most_extreme_values/SR10_low_temp.png new file mode 100644 index 0000000..02ef1aa Binary files /dev/null and b/figures/most_extreme_values/SR10_low_temp.png differ diff --git a/figures/most_extreme_values/air_temp.png b/figures/most_extreme_values/air_temp.png new file mode 100644 index 0000000..a7c6407 Binary files /dev/null and b/figures/most_extreme_values/air_temp.png differ diff --git a/figures/most_extreme_values/high_precip.png b/figures/most_extreme_values/high_precip.png new file mode 100644 index 0000000..3eaea60 Binary files /dev/null and b/figures/most_extreme_values/high_precip.png differ diff --git a/figures/most_extreme_values/low_precip.png b/figures/most_extreme_values/low_precip.png new file mode 100644 index 0000000..f5532a0 Binary files /dev/null and b/figures/most_extreme_values/low_precip.png differ diff --git a/figures/puslinch_census.png b/figures/puslinch_census.png new file mode 100644 index 0000000..698b12f Binary files /dev/null and b/figures/puslinch_census.png differ diff --git a/figures/ranger_restoration_activities.png b/figures/ranger_restoration_activities.png new file mode 100644 index 0000000..713d419 Binary files /dev/null and b/figures/ranger_restoration_activities.png differ diff --git a/figures/ranger_restoration_sites.png b/figures/ranger_restoration_sites.png new file mode 100644 index 0000000..2523c74 Binary files /dev/null and b/figures/ranger_restoration_sites.png differ diff --git a/figures/regression/ammonium_model_assumptions.png b/figures/regression/ammonium_model_assumptions.png new file mode 100644 index 0000000..6acfe56 Binary files /dev/null and b/figures/regression/ammonium_model_assumptions.png differ diff --git a/figures/regression/chloride_assumptions.png b/figures/regression/chloride_assumptions.png new file mode 100644 index 0000000..34f18fc Binary files /dev/null and b/figures/regression/chloride_assumptions.png differ diff --git a/figures/regression/conductivity_asumptions.png b/figures/regression/conductivity_asumptions.png new file mode 100644 index 0000000..0e98b15 Binary files /dev/null and b/figures/regression/conductivity_asumptions.png differ diff --git a/figures/regression/conductivity_by_precip.png b/figures/regression/conductivity_by_precip.png new file mode 100644 index 0000000..ee27144 Binary files /dev/null and b/figures/regression/conductivity_by_precip.png differ diff --git a/figures/regression/conductivity_by_temp.png b/figures/regression/conductivity_by_temp.png new file mode 100644 index 0000000..2972130 Binary files /dev/null and b/figures/regression/conductivity_by_temp.png differ diff --git a/figures/regression/dissolved_oxygen_assumptions.png b/figures/regression/dissolved_oxygen_assumptions.png new file mode 100644 index 0000000..f6cf6d2 Binary files /dev/null and b/figures/regression/dissolved_oxygen_assumptions.png differ diff --git a/figures/regression/dissolved_oxygen_by_precip.png b/figures/regression/dissolved_oxygen_by_precip.png new file mode 100644 index 0000000..6333451 Binary files /dev/null and b/figures/regression/dissolved_oxygen_by_precip.png differ diff --git a/figures/regression/log_chloride_by_temp.png b/figures/regression/log_chloride_by_temp.png new file mode 100644 index 0000000..92c3595 Binary files /dev/null and b/figures/regression/log_chloride_by_temp.png differ diff --git a/figures/regression/nitrate_assumptions.png b/figures/regression/nitrate_assumptions.png new file mode 100644 index 0000000..18a66dc Binary files /dev/null and b/figures/regression/nitrate_assumptions.png differ diff --git a/figures/regression/nitrate_by_temp.png b/figures/regression/nitrate_by_temp.png new file mode 100644 index 0000000..bb93147 Binary files /dev/null and b/figures/regression/nitrate_by_temp.png differ diff --git a/figures/regression/nitrite_assumptions.png b/figures/regression/nitrite_assumptions.png new file mode 100644 index 0000000..41adb4f Binary files /dev/null and b/figures/regression/nitrite_assumptions.png differ diff --git a/figures/regression/nitrite_by_precip.png b/figures/regression/nitrite_by_precip.png new file mode 100644 index 0000000..20c1864 Binary files /dev/null and b/figures/regression/nitrite_by_precip.png differ diff --git a/figures/regression/ph_assumptions.png b/figures/regression/ph_assumptions.png new file mode 100644 index 0000000..d92144d Binary files /dev/null and b/figures/regression/ph_assumptions.png differ diff --git a/figures/regression/ph_by_temp.png b/figures/regression/ph_by_temp.png new file mode 100644 index 0000000..3fffbf1 Binary files /dev/null and b/figures/regression/ph_by_temp.png differ diff --git a/figures/regression/phosphate_assumptions.png b/figures/regression/phosphate_assumptions.png new file mode 100644 index 0000000..9415ec3 Binary files /dev/null and b/figures/regression/phosphate_assumptions.png differ diff --git a/figures/regression/phosphate_by_precip.png b/figures/regression/phosphate_by_precip.png new file mode 100644 index 0000000..91a773d Binary files /dev/null and b/figures/regression/phosphate_by_precip.png differ diff --git a/figures/regression/sqrt_ammonium_by_temp.png b/figures/regression/sqrt_ammonium_by_temp.png new file mode 100644 index 0000000..903a6c6 Binary files /dev/null and b/figures/regression/sqrt_ammonium_by_temp.png differ diff --git a/figures/regression/temp_assumptions.png b/figures/regression/temp_assumptions.png new file mode 100644 index 0000000..2e047a6 Binary files /dev/null and b/figures/regression/temp_assumptions.png differ diff --git a/figures/regression/water_by_air_temp.png b/figures/regression/water_by_air_temp.png new file mode 100644 index 0000000..285ac8f Binary files /dev/null and b/figures/regression/water_by_air_temp.png differ diff --git a/figures/trout/brown_brook_yoy.png b/figures/trout/brown_brook_yoy.png new file mode 100644 index 0000000..908bd60 Binary files /dev/null and b/figures/trout/brown_brook_yoy.png differ diff --git a/figures/trout/trout_per_hectare.png b/figures/trout/trout_per_hectare.png new file mode 100644 index 0000000..ffc260c Binary files /dev/null and b/figures/trout/trout_per_hectare.png differ diff --git a/figures/water_quality/ammonium.png b/figures/water_quality/ammonium.png new file mode 100644 index 0000000..de147ba Binary files /dev/null and b/figures/water_quality/ammonium.png differ diff --git a/figures/water_quality/chloride.png b/figures/water_quality/chloride.png new file mode 100644 index 0000000..4d1e369 Binary files /dev/null and b/figures/water_quality/chloride.png differ diff --git a/figures/water_quality/conductivity.png b/figures/water_quality/conductivity.png new file mode 100644 index 0000000..e91d30c Binary files /dev/null and b/figures/water_quality/conductivity.png differ diff --git a/figures/water_quality/do.png b/figures/water_quality/do.png new file mode 100644 index 0000000..8e36eff Binary files /dev/null and b/figures/water_quality/do.png differ diff --git a/figures/water_quality/nitrate.png b/figures/water_quality/nitrate.png new file mode 100644 index 0000000..8ffd5d1 Binary files /dev/null and b/figures/water_quality/nitrate.png differ diff --git a/figures/water_quality/nitrite.png b/figures/water_quality/nitrite.png new file mode 100644 index 0000000..a5f3299 Binary files /dev/null and b/figures/water_quality/nitrite.png differ diff --git a/figures/water_quality/pH.png b/figures/water_quality/pH.png new file mode 100644 index 0000000..2b018d9 Binary files /dev/null and b/figures/water_quality/pH.png differ diff --git a/figures/water_quality/phosphate.png b/figures/water_quality/phosphate.png new file mode 100644 index 0000000..c6d33c0 Binary files /dev/null and b/figures/water_quality/phosphate.png differ diff --git a/mill-creek.Rproj b/mill-creek.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/mill-creek.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX