## Import Data

Functions for user-generated or web retrieval data.

readUserDaily()

Import user daily data for EGRET analysis

readUserSample()

Import user-supplied sample data for EGRET analysis

readNWISDaily()

Import NWIS Daily Data for EGRET analysis

readNWISSample()

Import NWIS Sample Data for EGRET analysis

readWQPSample()

Import Sample Data from the Water Quality Portal for WRTDS

readNWISInfo() readWQPInfo() readUserInfo()

Import metadata to create INFO data frame

## WRTDS

Functions working running and analyzing the WRTDS model

modelEstimation()

Estimation process for the WRTDS (Weighted Regressions on Time, Discharge, and Season)

setUpEstimation()

setUpEstimation

WRTDSKalman()

WRTDS-Kalman

runPairs()

Runs a comparison of any two years in the record.

runGroups()

Runs a comparison of any group of years in the record.

runSeries()

Annual series of flow-normalized concentration and flow-normalized flux

runSurvReg() run_WRTDS()

Run the weighted survival regression for a set of estimation points (defined by DecYear and Log(Q))

estCrossVal()

Jack-Knife cross validation of the WRTDS (Weighted Regressions on Time, Discharge, and Season)

estDailyFromSurfaces() getConcFluxFromSurface() getSurfaceEstimates() bin_Qs()

Estimates all daily values of Concentration, Flux, Flow-Normalized Concentration, and Flow Normalized Flux

estSurfaces()

Estimate the three surfaces (for yHat, SE and ConcHat) as a function of DecYear and logQ and store in the three-dimensional object called surfaces

flexFN()

Flexible Flow Normalization

## Plot Data

Functions for plotting eList objects

multiPlotDataOverview()

Produces a 4 panel plot that gives an overview of the data set prior to any processing

plotFluxTimeDaily()

Plot of the time series of daily flux estimates and the sample values for the days that were sampled

plotFlowSingle()

Creates a plot of a time series of a particular flow statistic and a loess smooth of that flow statistic

plotFluxQ()

Sample data plot: observed log flux vs log discharge

plotFour()

Makes four graphs of streamflow statistics on a single page

plotFourStats()

Makes four graphs of annual streamflow statistics on a single page

plotQTimeDaily()

Plot of the discharge time series

plotSDLogQ()

Graph of the standard deviation of the log of daily discharge versus year

boxConcMonth()

Box plot of the water quality data by month

boxQTwice()

Two box plots side-by-side, discharge on sample days, and discharge on all days

plotConcTime()

Plot of Observed Concentration versus Time

plotConcQ()

Plot of Observed Concentration versus Discharge

plotConcTimeDaily()

Plot of the time series of daily concentration estimates and the sample values for the days that were sampled

boxConcThree()

Three box plots side-by-side

plot15()

Makes 15 graphs of streamflow statistics on a single page. These encompass the 7-day minimum, mean, and 1-day maximum for each of the following 5 Periods of Analysis: Annual, Fall, Winter, Spring and Summer.

plot1of15()

plots 1 of the 15 graphs of streamflow statistics on a single page

## Plot Model Outputs

Functions for plotting modeled eList objects

plotConcPred()

Plot of Observed Concentration versus Estimated Concentration

plotFluxPred()

Graph of observed versus estimated flux

plotResidPred()

Plot of the residuals from WRTDS versus the estimated values (all in log concentration units)

plotResidQ()

Plot of the residuals from WRTDS (in log concentration units) versus the discharge

plotResidTime()

Plot of the residuals from WRTDS (in log concentration units) versus time

boxResidMonth()

A box plot of WRTDS residuals by month

plotConcHist()

Graph of annual concentration and flow normalized concentration versus year

plotFluxHist()

Graph of annual flux and flow normalized flux versus year

plotConcQSmooth()

Plot up to three curves representing the concentration versus discharge relationship. Each curve is a different point in time.

plotConcTimeSmooth()

Plot up to three curves representing the concentration versus time relationship, each curve representing a different flow.

fluxBiasMulti()

Produces 8-panel plot that is useful for determining if there is a flux bias problem

plotContours()

Color contour plot of the estimated surfaces as a function of discharge and time (surfaces include log concentration, standard error, and concentration)

plotDiffContours()

Plots the difference between two years from a contour plot created by plotContours

plotWRTDSKalman()

plotWRTDSKalman

plotTimeSlice()

plotTimeSlice

flexPlotAddOn()

Flexible Flow Normalization Plot Add On

## Table

Functions for creating tables from eList objects

printSeries()

Print annual results for a given streamflow statistic

makeAnnualSeries()

Produces annual series of 8 streamflow statistics (and a lowess smooth of them) from daily streamflow data

tableChange() tableChangeSingle()

Create a table of the changes in flow-normalized values between various points in time in the record

tableFlowChange()

Prints table of change metrics for a given streamflow statistic

tableResults()

Table of annual results for discharge, concentration and flux

setupYears()

Creates the AnnualResults data frame from the Daily data frame

calculateMonthlyResults()

Calculates monthly mean values of Q, Conc, FNConc, Flux, and FNFlux for the entire record. If WRTDSKalman has been run it also includes the monthly mean values of GenConc and GenFlux.

## Utilities

blankTime()

Deletes the computed values during periods of time when there are no sample data

cleanUp()

cleanUp eList

compressData()

Compress sample data frame

cumQdate()

Cumulative flow calculation

dataOverview()

Data Overview for WRTDS

decimalDate()

decimalDate

errorStats()

Error statistics

fixSampleFrame()

Update Sample dataframe

flowDuration()

Computes several values of the flow duration curve for streamflow centered on a specific date of the year

fluxBiasStat()

Compute the flux bias statistic: (mean of estimated flux - mean of observed flux) / mean of estimated flux

getDaily()

Get Daily dataframe from EGRET object

getInfo()

Get INFO dataframe from EGRET object

getSample() getSample() getSample.default()

Get Sample dataframe from EGRET object

getSurfaces()

Get surfaces matrix from EGRET object

jitterSam()

jitter Sample

makeAugmentedSample()

Create randomized residuals and observations for data sets that have some censored data

mergeReport()

mergeReport

print(<egret>) plot(<egret>) nDischarge() nObservations() nCensoredVals()

EGRET helper functions

printFluxUnitCheatSheet()

Reminder to user of flux unit properties (such as kg/day, tons/year, etc).

printqUnitCheatSheet()

Reminder to user of flow Unit properties such as cubic meters per second or thousands of cubic feet per second.

processQWData()

Processing of Water Quality Data

randomSubset()

randomSubset

removeDuplicates()

Remove duplicates values from Sample data frame.

saveResults()

A utility program for saving the contents of the workspace This function saves the workspace. It assigns the file a name using the abbreviations for station and constituent.

setPA()

Sets up the period of analysis (the portion of the year being evaluated).

stitch()

stitch surfaces

triCube()

Tricube weight function