https://github.com/mps9506/example-leon-river-data
https://github.com/mps9506/example-leon-river-data
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mps9506/example-leon-river-data
- Owner: mps9506
- Created: 2023-09-12T19:22:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-12T19:44:15.000Z (over 1 year ago)
- Last Synced: 2025-02-24T06:41:39.055Z (3 months ago)
- Language: R
- Size: 12.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
title: "Example Simple Water Quality Scatter Plots"
output: github_document
---```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```## Example repo for TWRI staff and students
This repository provide some example scripts for producing
simple time series scatter plots of water quality parameters
using TCEQ's SWQM data by TCEQ assessment units.The `script.R` file is a long script that uses ggplot
and associated functions to produce figures showing
*E. coli*, DO, NO~3~, and TP measurements over time
with a trend line fit over the data. There is a lot of
redundant code in this script file which can be the source
of errors when generating plots.The `functionalized_script.R` accomplishes the same task in
many fewer lines by using more of a functionalized workflow and
the `purrr` package. Importantly, this reduces errors and speeds up
data processing, but requires a slightly more advanced understanding of R.
The `functionalized_script.R` could further reduce lines by iterating functions
that read and format data before plotting.Installation instructions for packages that are required for these scripts:
```r
install.packages(c("tidyverse","janitor", "ggtext", "ragg"))
install.packages("twriTemplates", repos = c(
txwri = 'https://txwri.r-universe.dev',
CRAN = 'https://cloud.r-project.org'))
``````{r echo=FALSE, message=FALSE, warning=FALSE}
knitr::include_graphics("ex_out/1121_Leon_NO3.png")
```