Movatterモバイル変換


[0]ホーム

URL:


Overview

Marcus W. Beck,mbeck@tbep.org

Overview

The System Wide Monitoring Program (SWMP) wasimplemented by the National Estuarine Research Reserve System (NERRS) in 1995 to providecontinuous monitoring data at over 140 continuous monitoring stations in28 estuaries across the United States. SWMPr (pronounced “swamper”) isan R package for retrieving, organizing, and analyzing estuarymonitoring data from SWMP. Please cite the package 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

Installing the package

Install the package from CRAN as follows:

install.packages('SWMPr')library(SWMPr)

The development (unstable) version of this package can be installedfrom Github:

install.packages('devtools')library(devtools)install_github('fawda123/SWMPr',ref ='development')library(SWMPr)

Using the package

A manuscript describing full use of the package is available from theRJournal. All source materials for the manuscript are availablehere. A briefdescription of the available functions is provided below. See helpdocumentation for more details on each function (e.g.,?all_params). All functions are grouped into respectivecategories that describe their use: retrieve, organize, and analyze.Help files for functions in each category can be viewed as follows:

help.search('retrieve',package ='SWMPr')help.search('organize',package ='SWMPr')help.search('analyze',package ='SWMPr')

Retrieve

all_paramsRetrieve any number of records starting with the most recent at a givenstation, all parameters. Wrapper toexportAllParamsXMLNewfunction on web services.
all_params_dtrngRetrieve records of all parameters within a given date range for astation. Optional argument for a single parameter. Wrapper toexportAllParamsDateRangeXMLNew.
import_localImport files from a local path. The files must be in a specific format,specifically those returned from the CDMO using thezip downloadsoption for a reserve.
import_remoteImport SWMP site data from a remote independent server. These files havebeen downloaded from CDMO, processed using functions in this package,and uploaded to an Amazon server for quicker import into R.
single_paramRetrieve any number of records for a single parameter starting with themost recent at a given station. Wrapper toexportSingleParamXMLNew function on web services.
site_codesMetadata for all stations, wrapper toexportStationCodesXMLNew function on web services.
site_codes_indMetadata for all stations at a single site, wrapper toNERRFilterStationCodesXMLNew function on web services.

Organize

cens_idCreates additional columns in a swmpr object that identify observationsbelow, within, or above the detection limit.
combCombines swmpr objects to a common time series using setstep, such ascombining the weather, nutrients, and water quality data for a singlestation. Only different data types can be combined.
qaqcRemove QAQC columns and remove data based on QAQC flag values for aswmpr object. Only applies if QAQC columns are present.
qaqcchkView a summary of the number of observations in a swmpr object that areassigned to different QAQC flags used by CDMO. The output is used toinform further processing but is not used explicitly.
rem_repsRemove replicate nutrient data that occur on the same day. The defaultis to average replicates.
setstepFormat data from a swmpr object to a continuous time series at a giventimestep. The function is used incomb and can also be usedwith individual stations.
subsetSubset by dates and/or columns for a swmpr object. This is a methodpassed to the generic `subset’ function provided in the base package.

Analyze

aggreswmpAggregate swmpr objects for different time periods - years, quarters,months, weeks, days, or hours. Aggregation function is user-supplied butdefaults to mean.
aggremetabAggregate metabolism data from a swmpr object. This is primarily usedwithinplot_metab but may be useful for simple summaries ofraw daily data.
ecometabEstimate ecosystem metabolism for a combined water quality and weatherdataset using the open-water method.
decompDecompose a swmpr time series into trend, seasonal, and residualcomponents. This is a simple wrapper todecompose.Decomposition of monthly or daily trends is possible.
decomp_cjDecompose a swmpr time series into grandmean, annual, seasonal, andevents components. This is a simple wrapper todecompTs inthe wq package. Only monthly decomposition is possible.
histPlot a histogram for a swmpr object.
linesAdd lines to an existing swmpr plot.
map_reserveCreate a map of all stations in a reserve using the ggmap package.
na.approxLinearly interpolate missing data (NA values) in a swmprobject. The maximum gap size that is interpolated is defined as amaximum number of records with missing data.
overplotPlot multiple SWMP time series on the same y-axis.
plotPlot a univariate time series for a swmpr object. The parameter namemust be specified.
plot_metabPlot ecosystem metabolism estimates after runningecometabon a swmpr object.
plot_summaryCreate summary plots of seasonal/annual trends and anomalies for a waterquality or weather parameter.
plot_windCreate a wind rose using weather data.
smootherSmooth swmpr objects with a moving window average. Window size and sidescan be specified, passed tofilter.

Miscellaneous

calcKLEstimate the reaeration coefficient for air-sea gas exchange. This isonly used within theecometab function.
metab_dayIdentify the metabolic day for each approximate 24 period in an hourlytime series. This is only used within theecometabfunction.
param_namesReturns column names as a list for the parameter type(s) (nutrients,weather, or water quality). Includes QAQC columns with ‘f_’ prefix. Usedinternally in other functions.
parserParses html returned from CDMO web services, used internally inretrieval functions.
swmprCreates object of swmpr class, used internally in retrieval functions.
time_vecConverts time vectors to POSIX objects with correct time zone for asite/station, used internally in retrieval functions.

[8]ページ先頭

©2009-2025 Movatter.jp