SkillAgentSearch skills...

SWMPrExtension

Functions for Analyzing and Plotting SWMP Estuary Monitoring Data from the NERR System archive at

Install / Use

/learn @NOAA-OCM/SWMPrExtension
About this skill

Quality Score

0/100

Category

Operations

Supported Platforms

Universal

README

<!-- [![Travis-CI Build Status](https://travis-ci.org/LimnoTech/SWMPrExtension.svg?branch=master)](https://travis-ci.org/LimnoTech/SWMPrExtension)--> <!-- Start badges -->

CRAN_Status_BadgeDownloads
from the RStudio CRAN
mirror

<!-- End badges --> <!-- README.md is generated from README.Rmd. Please edit that file -->

Overview

The System Wide Monitoring Program (SWMP) was implemented by the National Estuarine Research Reserve System (NERRS) in 1995 to provide continuous monitoring data at over 140 continuous monitoring stations in 28 estuaries across the United States. SWMPrExtension (pronounced “swamper extension”) is an R package that provides additional functions to organize and analyze SWMP data and is intended as a companion package for SWMPr (pronounced “swamper”). Currently, there is no citation for SWMPrExtension.

SWMPr is an R package for retrieving, organizing, and analyzing estuary monitoring data from SWMP. SWMPr can be cited as follows:

Beck MW. 2016. SWMPr: An R package for retrieving, organizing, and analyzing environmental data for estuaries. The R Journal. 8(1):219-232. https://journal.r-project.org/archive/2016-1/beck.pdf

NOAA Open Source Disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an ?as is? basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

Installing the package

Install the package from CRAN:

install.packages('SWMPrExtension')
library(SWMPrExtension)

Install the development (unstable) version from Github:

install.packages('devtools')
library(devtools)
install_github('NOAA-OCM/SWMPrExtension')
library(SWMPrExtension)

Using the package

Documentation for SWMPrExtension is currently in development.

A quick summary of the SWMPr package can be found here. A detailed manuscript describing full use of the SWMPr package is available from the R Journal. All source materials for the manuscript are available here.

SWMPrExtension adds several functions to existing concepts in SWMPr and introduces a new concept called “Reporting”.

<h3>

Analyze

</h3>

The core analyses available within the SWMPrExtension R package and used to create the reserve level annual report fall into four general categories: boxplots and barplots, range plots, threshold plots, and trend plots. There is also an additional category called “mapping” which contains functions that generate many of maps associated with the reserve-level reports. The analyses, methods, and maps in this section were selected by and approved by a technical advisory committee composed of NERR research coordinators, SWMP technicians and CDMO staff.

<h4>

Core Analyses

</h4> <table> <tr> <td>

<code>annual_range.swmpr</code>

</td> <td>

For a user-specified year, calculate averages, average ranges, and min/max observed ranges the on a monthly or seasonal basis.

</td> </tr> <tr> <td>

<code>historical_daily_range.swmpr</code>

</td> <td>

Compare a user-specified year against historical data on a daily basis.

</td> </tr> <tr> <td>

<code>historical_range.swmpr</code>

</td> <td>

Compare a user-specified year against historical data on a monthly/seasonal basis.

</td> </tr> <tr> <td>

<code>raw_boxplot.swmpr</code>

</td> <td>

Generate a monthly/seasonal boxplots of raw data for a target year.

</td> </tr> <tr> <td>

<code>seasonal_barplot.swmpr</code>

</td> <td>

Generate monthly/seasonal barplot for parameters that are better viewed in on a cumulative basis (e.g. precipitation).

</td> </tr> <tr> <td>

<code>seasonal_boxplot.swmpr</code>

</td> <td>

Generate monthly/seasonal boxplots for daily average statistics (min/average/max) across a user-specified time period.Includes the option to calculate a median value for a target year and include a line for a water quality threshold.

</td> </tr> <tr> <td>

<code>seasonal_dot.swmpr</code>

</td> <td>

Plot average/min/max seasonal values faceted by season.

</td> </tr> <tr> <td>

<code>sk_seasonal.swmpr</code>

</td> <td>

Seasonal Kendall non-parametric test for monotonic seasonal trends.

</td> </tr> <tr> <td>

<code>threshold_criteria_plot.swmpr</code>

</td> <td>

Compare raw data against user-specified water quality thresholds

</td> </tr> <tr> <td>

<code>threshold_identification.swmpr</code>

</td> <td>

Identify dates and times that a user-specified water quality threshold is exceeded. For continuous monitoring data, the user can also specify the length of time the threshold must be exceeded for the event to be included (e.g. DO must be < 2 mg/L for at least 2 hours).

</td> </tr> <tr> <td>

<code>threshold_percentile_plot.swmpr</code>

</td> <td>

Compare raw data against user-specified percentiles calculated from historical data. User has the option to calculate percentiles on a monthly basis.

</td> </tr> <tr> <td>

<code>threshold_summary.swmpr</code>

</td> <td>

Summarize the results from <code>threshold_identification</code> in either a plot or tabular format. Results can be aggregated on a monthly, seasonal, or annual basis.

</td> </tr> </table> <h4>

Mapping

</h4> <table> <tr> <td>

<code>national_sk_map</code>

</td> <td>

Create a base map for NERRS reserves in ggplot with seasonal kendall results.

</td> </tr> <tr> <td>

<code>res_custom_map</code>

</td> <td>

Create a stylized reserve-level map of custom station locations for use with the reserve level reporting template.

</td> </tr> <tr> <td>

<code>res_custom_sk_map</code>

</td> <td>

Create a stylized reserve-level map of seasonal kendall results from custom station locations for use with the reserve level reporting template.

</td> </tr> <tr> <td>

<code>res_local_map</code>

</td> <td>

Create a stylized reserve-level map for use with the reserve level reporting template.

</td> </tr> <tr> <td>

<code>res_national_map</code>

</td> <td>

Create a base map for NERRS reserves in ggplot.

</td> </tr> <tr> <td>

<code>res_sk_map</code>

</td> <td>

Create a stylized reserve-level map of seasonal kendall results for use with the reserve level reporting template.

</td> </tr> </table> <h3>

Retrieve

</h3>

in the <code>SWMPr</code> package, retrieve functions help the user load SWMP data into R. </br>

<table> <tr> <td>

<code>import_local_nut</code>

</td> <td>

A modified version of <code>import_local</code> from the <code>SWMPr</code> package. This version allows the user to specify the collection method (<code>CollMethd</code>) argument to separate monthly nutrient sampling data from monthly 24-hr nutrient sampling data.

</td> </tr> </table> <h3>

Reporting

</h3>

The new concept of reporting refers to functions that were specifically developed for use with NERRS reserve-level & national-level reporting scripts that are used to generate the reserve-level and national-level annual reports. They are included as part of this package in case users find them useful for their own purposes.

<h4>

Reserve Level Template

</h4> <table> <tr> <td>

<code>create_sk_flextable_list</code>

</td> <td>

Create a list of <code>flextable</code> objects to display Seasonal Kendall results in the NERRS reserve level template.

</td> </tr> <tr> <td>

<code>geographic_unique_stations</code>

</td> <td>

Creates an alphabetically sorted, vector of geographically unique stations for mapping. Intended for use with <code>res_local_map</code>.

</td> </tr> <tr> <td>

<code>get_reserve</code>

</td> <td>

Return the full name of the reserve associated with the data files in the ‘data’ folder of the reserve level template.

</td> </tr> <tr> <td>

<code>get_shp_name</code>

</td> <td>

Return the name of the shape file associated with the data files in the ‘data’ folder of the reserve level template.

</td> </tr> <tr> <td>

<code>get_site_code</code>

</td> <td>

Return the 3 letter reserve code associated with the reserve.

</td> </tr> <tr> <td>

<code>get_site_coordinates</code>

</td> <td>

Return the station coordinates for stations associated with the data fil

View on GitHub
GitHub Stars12
CategoryOperations
Updated7mo ago
Forks6

Languages

R

Security Score

67/100

Audited on Aug 21, 2025

No findings