An open API service indexing awesome lists of open source software.

https://github.com/mps9506/schramm-gitter-gregory-2020-tmdl-data

:droplet: data and code for "Total Maximum Daily Loads and Escherichia coli trends in Texas freshwater streams
https://github.com/mps9506/schramm-gitter-gregory-2020-tmdl-data

Last synced: 3 months ago
JSON representation

:droplet: data and code for "Total Maximum Daily Loads and Escherichia coli trends in Texas freshwater streams

Awesome Lists containing this project

README

        

---
title: "Total Maximum Daily Loads and Escherichia coli trends in Texas freshwater streams "
output:
github_document:
html_preview: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

[![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
[![DOI](https://zenodo.org/badge/307874510.svg)](https://zenodo.org/badge/latestdoi/307874510)

```{r builddate, echo=FALSE}
paste0("Time of last build: ", Sys.time())
```

This repository contains the data and code for:

Schramm, M., Gitter, A. and Gregory, L. (2022), Total Maximum Daily Loads and Escherichia coli Trends in Texas Freshwater Streams. Journal of Contemporary Water Research & Education, 176: 36-49. https://doi.org/10.1111/j.1936-704X.2022.3374.x

## Introduction

This project uses R and the `drake` package to manage workflow and promote reproducibility. Research data and metadata are located in:

```
data/cleaned_data.csv
data/flow_adjusted_mk_results.csv
data/unadjusted_mk_results.csv
data/metadata/
```

These data are documented here: [mps9506.github.io/schramm-gitter-gregory-2020-tmdl-data/](https://mps9506.github.io/schramm-gitter-gregory-2020-tmdl-data/)

## Reproduce the Project

If you would like to reproduce the project please follow the suggested guidelines below. The required R packages are detailed at the end.

### Requirements

- **NHD Plus**: This project utilizes the NHD National Seamless geodatabase. This is not included in the repository due to size. If you have a local copy, the source code can be modified to point to it. Otherwise, use `nhdplusTools` to download a copy.

```{r eval=FALSE}
nhdplusTools::download_nhdplusV2(outdir = here::here("data"))
```

## Building the project

### Check for evidence of reproducibility

```{r eval=FALSE}
renv::restore()
library(drake)
make(plan)
config <- drake_config(plan)
outdated(config)
```

### Replicate the project

```{r eval=FALSE}
clean()
source("R/packages.R")
source("R/download_data.R")
source("R/mann-kendall-tests.R")
source("R/logistic_regression.R")
source("R/figures.R")
source("R/tables.R")
source("R/plan.R")

###########################
#### set local options ####
###########################

# specify path to your nhdplus database
nhd_data <- "E:\\TWRI\\Data-Resources\\NHDPlusV21_NationalData_Seamless_Geodatabase_Lower48_07\\NHDPlusNationalData\\NHDPlusV21_National_Seamless_Flattened_Lower48.gdb"

##########################################################
#### You shouldn't need to modify anything after this ####
##########################################################

nhdplus_path(nhd_data)

make(
plan
)
```

## Info

Code and data are shared under the CC By 4.0 license. If you use the code or data, please cite this source per the DOI and the DOI of the paper.

### System config

```{r include=FALSE}
source("R/packages.R") # loads packages
```

```{r echo=FALSE}
sessioninfo::session_info()
```