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
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.
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)
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”.
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.
|
For a user-specified year, calculate averages, average ranges, and min/max observed ranges the on a monthly or seasonal basis. |
|
Compare a user-specified year against historical data on a daily basis. |
|
Compare a user-specified year against historical data on a monthly/seasonal basis. |
|
Generate a monthly/seasonal boxplots of raw data for a target year. |
|
Generate monthly/seasonal barplot for parameters that are better viewed in on a cumulative basis (e.g. precipitation). |
|
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. |
|
Plot average/min/max seasonal values faceted by season. |
|
Seasonal Kendall non-parametric test for monotonic seasonal trends. |
|
Compare raw data against user-specified water quality thresholds |
|
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). |
|
Compare raw data against user-specified percentiles calculated from historical data. User has the option to calculate percentiles on a monthly basis. |
|
Summarize the results from |
|
Create a base map for NERRS reserves in ggplot with seasonal kendall results. |
|
Create a stylized reserve-level map of custom station locations for use with the reserve level reporting template. |
|
Create a stylized reserve-level map of seasonal kendall results from custom station locations for use with the reserve level reporting template. |
|
Create a stylized reserve-level map for use with the reserve level reporting template. |
|
Create a base map for NERRS reserves in ggplot. |
|
Create a stylized reserve-level map of seasonal kendall results for use with the reserve level reporting template. |
in the SWMPr
package, retrieve functions help the user load
SWMP data into R.
|
A modified version of |
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.
|
Create a list of |
|
Creates an alphabetically sorted, vector of geographically unique
stations for mapping. Intended for use with
|
|
Return the full name of the reserve associated with the data files in the ‘data’ folder of the reserve level template. |
|
Return the name of the shape file associated with the data files in the ‘data’ folder of the reserve level template. |
|
Return the 3 letter reserve code associated with the reserve. |
|
Return the station coordinates for stations associated with the data files in the ‘data’ folder of the reserve level template. |
|
Return the stations associated with the data files in ‘data’ folder of the reserve level template. |
|
Load and format shapefile for use with res_local_map. |
|
Create a |
|
Create a |
|
Summarise the seasonal kendall results from reserve level report hand-off files. |
Miscellaneous functions are generally helper functions that are called internally by other analysis functions.
|
Assign seasons to SWMPr sampling data on a monthly basis or user-defined basis. Used by multiple analysis functions to group sampling data into user-defined seasons. |
|
Generate a dataframe of p-value labels based on p-values from linear
regression. Used internally by |
|
Select reasonable labels for breaks used in
|
|
A helper function to select reasonable breaks for
|
|
Tidy results from |
|
Determine if a parameter is one of the standard SWMP parameters. |
|
Generate a plot title based on SWMP station abbreviation. Used internally by several analysis functions. |
|
Generate a y-axis label based on SWMP parameter abbreviation. Used internally by several analysis functions. |
|
Generate a y-axis label based on SWMP parameter abbreviation and threshold criteria. Used internally by several analysis functions. |
|
Create a dataframe of selected NERRS locations for plotting with
|
|
Convert |
|
Filters a |
|
Filters a |
|
Removes |
The following data sets are included within the
SWMPrExtension
package. They are used for examples and for
mapping.
|
A shapefile of the reserve boundary for Chesapeake Bay-Maryland NERR.
Available from: |
|
A shapefile of the reserve boundary for Elkhorn Slough NERR. Available
from: |
|
Nutrient data (2007-2016) from North Marsh station at Elkhorn Slough NERR. |
|
Water quality data (2007-2016) from South Marsh station at Elkhorn Slough NERR. |
|
Metadata on NERRS stations provided by the Central Data Management
Office (CDMO) when data is downloaded. Additional formatting applied in
order to make the dataset useful to several |
|
US County boundaries from the US Census Bureau’s MAF/TIGER geographic database, modified to remove non-ASCII characters. Reprojected using Lambert Azimuthal Equal Area. Used to create national-level maps. |