SWMPrExtension
Functions for Analyzing and Plotting SWMP Estuary Monitoring Data from the NERR System archive at
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
4 of 8 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.3%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Functions for Analyzing and Plotting SWMP Estuary Monitoring Data from the NERR System archive at
Basic Info
- Host: GitHub
- Owner: NOAA-OCM
- License: other
- Language: R
- Default Branch: master
- Homepage: http://cdmo.baruch.sc.edu/
- Size: 344 MB
Statistics
- Stars: 12
- Watchers: 8
- Forks: 6
- Open Issues: 2
- Releases: 12
Created about 9 years ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output:
md_document:
variant: gfm
---

[](https://cran.r-project.org/package=SWMPrExtension)[](https://cran.rstudio.com/package=SWMPrExtension)
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# Overview
The System Wide Monitoring Program ([SWMP](https://nerrs.noaa.gov/RCDefault.aspx?ID=18)) was implemented by the National Estuarine Research Reserve System ([NERRS](https://nerrs.noaa.gov/)) 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](https://github.com/fawda123/SWMPr) (pronounced "swamper"). Currently, there is no citation for SWMPrExtension.
[SWMPr](https://github.com/fawda123/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:
```{r eval = F, message = F}
install.packages('SWMPrExtension')
library(SWMPrExtension)
```
Install the development (unstable) version from Github:
```{r eval = F, message = F}
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](https://github.com/fawda123/SWMPr). A detailed manuscript describing full use of the SWMPr package is available from the [R Journal](https://journal.r-project.org/archive/accepted/beck.pdf). All source materials for the manuscript are available [here](https://github.com/fawda123/swmpr_manu).
SWMPrExtension adds several functions to existing concepts in SWMPr and introduces a new concept called "Reporting".
Analyze
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.
Core Analyses
annual_range.swmpr | For a user-specified year, calculate averages, average ranges, and min/max observed ranges the on a monthly or seasonal basis. |
historical_daily_range.swmpr | Compare a user-specified year against historical data on a daily basis. |
historical_range.swmpr | Compare a user-specified year against historical data on a monthly/seasonal basis. |
raw_boxplot.swmpr | Generate a monthly/seasonal boxplots of raw data for a target year. |
seasonal_barplot.swmpr | Generate monthly/seasonal barplot for parameters that are better viewed in on a cumulative basis (e.g. precipitation). |
seasonal_boxplot.swmpr | 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. |
seasonal_dot.swmpr | Plot average/min/max seasonal values faceted by season. |
sk_seasonal.swmpr | Seasonal Kendall non-parametric test for monotonic seasonal trends. |
threshold_criteria_plot.swmpr | Compare raw data against user-specified water quality thresholds |
threshold_identification.swmpr | 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). |
threshold_percentile_plot.swmpr | Compare raw data against user-specified percentiles calculated from historical data. User has the option to calculate percentiles on a monthly basis. |
threshold_summary.swmpr | Summarize the results from threshold_identification in either a plot or tabular format. Results can be aggregated on a monthly, seasonal, or annual basis. |
Mapping
national_sk_map | Create a base map for NERRS reserves in ggplot with seasonal kendall results. |
res_custom_map | Create a stylized reserve-level map of custom station locations for use with the reserve level reporting template. |
res_custom_sk_map | Create a stylized reserve-level map of seasonal kendall results from custom station locations for use with the reserve level reporting template. |
res_local_map | Create a stylized reserve-level map for use with the reserve level reporting template. |
res_national_map | Create a base map for NERRS reserves in ggplot. |
res_sk_map | Create a stylized reserve-level map of seasonal kendall results for use with the reserve level reporting template. |
Retrieve
in theSWMPr package, retrieve functions help the user load SWMP data into R.
import_local_nut | A modified version of import_local from the SWMPr package. This version allows the user to specify the collection method (CollMethd) argument to separate monthly nutrient sampling data from monthly 24-hr nutrient sampling data. |
Reporting
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.Reserve Level Template
create_sk_flextable_list | Create a list of flextable objects to display Seasonal Kendall results in the NERRS reserve level template. |
geographic_unique_stations | Creates an alphabetically sorted, vector of geographically unique stations for mapping. Intended for use with res_local_map. |
get_reserve | Return the full name of the reserve associated with the data files in the 'data' folder of the reserve level template. |
get_shp_name | Return the name of the shape file associated with the data files in the 'data' folder of the reserve level template. |
get_site_code | Return the 3 letter reserve code associated with the reserve. |
get_site_coordinates | Return the station coordinates for stations associated with the data files in the 'data' folder of the reserve level template. |
get_sites | Return the stations associated with the data files in 'data' folder of the reserve level template. |
load_shp_file | Load and format shapefile for use with res_local_map. |
National Level Template
create_sk_national_ft_reserves | Create a flextable of reserve names for use with the NERRS national level template. |
create_sk_national_ft_results | Create a flextable object to display Seasonal Kendall results for each reserve in the NERRS national level template. |
summarise_handoff_files | Summarise the seasonal kendall results from reserve level report hand-off files. |
Miscellaneous
Miscellaneous functions are generally helper functions that are called internally by other analysis functions.Analyze
assign_season | 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. |
lm_p_labs | Generate a dataframe of p-value labels based on p-values from linear regression. Used internally by seasonal_dot.swmpr to add linear regression results to the plot. |
set_date_break_labs | Select reasonable labels for breaks used in scale_x_datetime. Used internally by several analysis functions. |
set_date_breaks | A helper function to select reasonable breaks for scale_x_datetime. Used internally by several analysis functions. |
sk_tidy | Tidy results from EnvStats::kendallSeasonalTrendTest. Used by sk_seasonal.swmpr to tidy seasonal kendall test results. |
std_param_check | Determine if a parameter is one of the standard SWMP parameters. |
title_labeler | Generate a plot title based on SWMP station abbreviation. Used internally by several analysis functions. |
y_count_labeler | Generate a y-axis label based on SWMP parameter abbreviation. Used internally by several analysis functions. |
y_labeler | Generate a y-axis label based on SWMP parameter abbreviation and threshold criteria. Used internally by several analysis functions. |
Mapping
reserve_locs | Create a dataframe of selected NERRS locations for plotting with res_national_map. |
Reporting
ft_col_names | Convert SWMPr parameter abbreviations into formats appropriate for use with NERRS reserve level template flextable. Used internally by create_sk_flextable_list. |
generate_results_table | Filters a data.frame of user-specified results for display in the NERRS reserve level report. Used internally by create_sk_flextable_list. |
generate_station_table | Filters a data.frame of user-specified results for display in the NERRS reserve level report. Used internally by create_sk_flextable_list. |
remove_inf_and_nan | Removes -Inf, Inf, and NaN from a matrix. Used internally by several functions to prevent plotting errors. |
Datasets
The following data sets are included within theSWMPrExtension package. They are used for examples and for mapping.
cbm_spatial | A shapefile of the reserve boundary for Chesapeake Bay-Maryland NERR. Available from: https://cdmo.baruch.sc.edu/. |
elk_spatial | A shapefile of the reserve boundary for Elkhorn Slough NERR. Available from: https://cdmo.baruch.sc.edu/. |
elknmnut | Nutrient data (2007-2016) from North Marsh station at Elkhorn Slough NERR. |
elksmwq | Water quality data (2007-2016) from South Marsh station at Elkhorn Slough NERR. |
sampling_stations | 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 SWMPrExtension functions. |
us_4269 | US County boundaries from the US Census Bureau's MAF/TIGER geographic database, in projection EPSG = 4269. Used to create national-level maps. |
Owner
- Name: NOAA - Office for Coastal Management
- Login: NOAA-OCM
- Kind: organization
- Website: https://coast.noaa.gov/
- Repositories: 5
- Profile: https://github.com/NOAA-OCM
GitHub Events
Total
- Push event: 2
- Create event: 1
Last Year
- Push event: 2
- Create event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Julie | p****0@g****m | 386 |
| Dave Eslinger | d****r@n****v | 128 |
| Dave Eslinger | d****1@g****m | 8 |
| Dave Eslinger | d****r@f****v | 6 |
| Dave | O****g | 5 |
| Kirk Waters | k****s@n****v | 2 |
| Matt Dornback | m****k@n****v | 1 |
| fawda123 | m****2@g****m | 1 |
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 28
- Total pull requests: 32
- Average time to close issues: 4 months
- Average time to close pull requests: 1 day
- Total issue authors: 6
- Total pull request authors: 4
- Average comments per issue: 2.0
- Average comments per pull request: 0.09
- Merged pull requests: 28
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- padilla410 (18)
- DaveEslinger (4)
- swmpkim (3)
- simonpcouch (1)
- rsbivand (1)
- skdunnigan (1)
Pull Request Authors
- padilla410 (20)
- DaveEslinger (10)
- DavisVaughan (1)
- fawda123 (1)
Top Labels
Issue Labels
enhancement (9)
bug (3)
question (2)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 342 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 20
- Total maintainers: 1
cran.r-project.org: SWMPrExtension
Functions for Analyzing and Plotting Estuary Monitoring Data
- Documentation: http://cran.r-project.org/web/packages/SWMPrExtension/SWMPrExtension.pdf
- License: CC0
-
Latest release: 2.2.5
published over 2 years ago
Rankings
Forks count: 11.3%
Stargazers count: 17.9%
Average: 25.1%
Dependent packages count: 29.8%
Downloads: 31.1%
Dependent repos count: 35.5%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 4.0 depends
- SWMPr * depends
- EnvStats * imports
- RColorBrewer * imports
- broom * imports
- dplyr * imports
- flextable * imports
- ggimage * imports
- ggplot2 * imports
- ggthemes * imports
- grDevices * imports
- lubridate * imports
- magrittr * imports
- methods * imports
- officer * imports
- purrr * imports
- rlang * imports
- scales * imports
- sf * imports
- stats * imports
- tidyr * imports
- tidyselect * imports
- utils * imports
- ggmap * suggests