Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 189 additions & 0 deletions data-raw/comparisons/chl_pp.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
---
title: "Phytoplankton Indicators"
author: "Brandon Beltz"
date: "`r Sys.Date()`"
output:
html_document:
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(ecodata)
library(ecodata25)
library(dplyr)
library(knitr)

# Replace 'chl_pp' with intended dataset
dataset<-ecodata::chl_pp
dataset24<-ecodata25::chl_pp

# Define dataset-specific arguments for plot functions
report<-list("MidAtlantic","NewEngland")
variable<-list("chl","pp","size")
plottype<-list("weekly","monthly")
epu<-list("MAB","GOM","GB")
```

# Phytoplankton Figures {.tabset}

## `r paste(report[1],variable[1],plottype[1],epu[1])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[1], n = 10, varName = variable[1], plottype = plottype[1], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[1], n = 10, varName = variable[1], plottype = plottype[1], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[1],plottype[1],epu[2])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[1], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[1], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[1],plottype[1],epu[3])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[1], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[1], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[1],variable[1],plottype[2],epu[1])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[1], n = 10, varName = variable[1], plottype = plottype[2], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[1], n = 10, varName = variable[1], plottype = plottype[2], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[1],plottype[2],epu[2])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[2], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[2], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[1],plottype[2],epu[3])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[2], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[1], plottype = plottype[2], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[1],variable[2],plottype[1],epu[1])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[1], n = 10, varName = variable[2], plottype = plottype[1], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[1], n = 10, varName = variable[2], plottype = plottype[1], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[2],plottype[1],epu[2])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[1], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[1], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[2],plottype[1],epu[3])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[1], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[1], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[1],variable[2],plottype[2],epu[1])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[1], n = 10, varName = variable[2], plottype = plottype[2], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[1], n = 10, varName = variable[2], plottype = plottype[2], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[2],plottype[2],epu[2])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[2], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[2], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[2],plottype[2],epu[3])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[2], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[2], plottype = plottype[2], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[1],variable[3],plottype[1],epu[1])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[1], n = 10, varName = variable[3], plottype = plottype[1], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[1], n = 10, varName = variable[3], plottype = plottype[1], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[3],plottype[1],epu[2])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[1], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[1], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[3],plottype[1],epu[3])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[1], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[1], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[1],variable[3],plottype[2],epu[1])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[1], n = 10, varName = variable[3], plottype = plottype[2], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[1], n = 10, varName = variable[3], plottype = plottype[2], EPU = epu[1]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[3],plottype[2],epu[2])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[2], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[2], EPU = epu[2]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```

## `r paste(report[2],variable[3],plottype[2],epu[3])`
```{r, fig.show="hold", out.width="50%", echo=FALSE, message=FALSE, warning=FALSE}
ecodata::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[2], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2026") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))

ecodata25::plot_chl_pp(report = report[2], n = 10, varName = variable[3], plottype = plottype[2], EPU = epu[3]) +
ggplot2::ggtitle("SOE 2025") + ggplot2::theme(plot.title = ggplot2::element_text(size = 20))
```
485 changes: 485 additions & 0 deletions data-raw/comparisons/chl_pp.html

Large diffs are not rendered by default.

23 changes: 2 additions & 21 deletions data-raw/get_chl_pp.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,10 @@ library(stringr)
raw.dir <- here::here("data-raw")

# input files ----
chl_pp_csv <- "19980101_20241231-OCCCI-CHLOR_A_PPD_PSC_FMICRO_PSC_FNANO_PSC_FPICO_PSC_MICRO_PSC_NANO_PSC_PICO_PPD-STATS_ANOMS-NES_EPU_NOESTUARIES-SOE_PHYTOPLANKTON-SOE_FORMAT.csv"
chl_pp_csv <- "raw_input_chl_pp.csv"

# transformation ----
chl_pp <- read.csv(file.path(raw.dir, chl_pp_csv)) %>%
#dplyr::mutate(ALGORITHM = word(stringr::str_replace(ALGORITHM, "_", " "))) %>%
#tidyr::unite(.,VARIABLE, c("VARIABLE","SENSOR","ALGORITHM"), sep = " ") %>%
# dplyr::mutate(VARIABLE = ifelse(stringr::str_detect(FILENAME, "1998_2019"),
# paste(VARIABLE,"1998_2019"),
# ifelse(stringr::str_detect(FILENAME, "1998_2017"),
# paste(VARIABLE, "1998_2017"),
# ifelse(stringr::str_detect(FILENAME, "1997_2019"),
# paste(VARIABLE, "1997_2019"),
# ifelse(stringr::str_detect(FILENAME, "1997_2017"),
# paste(VARIABLE, "1997_2017"),
# VARIABLE))))) %>%
dplyr::select(PERIOD, VARIABLE, VALUE, SUBAREA, UNITS) %>%
dplyr::rename(Time = PERIOD, Units = UNITS, Var = VARIABLE,
EPU = SUBAREA, Value = VALUE) %>%
Expand All @@ -28,13 +18,4 @@ chl_pp <- read.csv(file.path(raw.dir, chl_pp_csv)) %>%

chl_pp <- as_tibble(chl_pp)

# metadata ----
attr(chl_pp, "tech-doc_url") <- "https://noaa-edab.github.io/tech-doc/chl-pp.html"
attr(chl_pp, "data_files") <- list(
chl_pp_csv = chl_pp_csv)
attr(chl_pp, "data_steward") <- c(
"Kimberly Hyde <kimberly.hyde@noaa.gov>")
attr(chl_pp, "plot_script") <- list(
`ltl_NE_anom` = "LTL_NE.Rmd-chl-pp-anom.R")

usethis::use_data(chl_pp, overwrite = T)
Binary file modified data/chl_pp.rda
Binary file not shown.
Loading