Learn R Programming

⚠️There's a newer version (2.0.12) of this package.Take me there.

baytrends

The baytrends package was developed to enable users to evaluate long-term trends in the Chesapeake Bay using a Generalized Additive Modeling (GAM) approach. The model development includes selecting a GAM structure to describe nonlinear seasonally-varying changes over time, incorporation of hydrologic variability via either a river flow or salinity, the use of an intervention to deal with method or laboratory changes suspected to impact data values, and representation of left- and interval-censored data. This approach, which is fully transferable to other systems, allows for Chesapeake Bay water quality data to be evaluated in a statistically rigorous, yet flexible way to provide insights to a range of management- and research-focused questions.

Copy Link

Version

Install

install.packages('baytrends')

Monthly Downloads

395

Version

1.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Erik Leppo

Last Published

March 14th, 2019

Functions in baytrends (1.1.0)

as.qw

Water-quality Data Conversion
createResiduals

Calculate GAM residuals
as.lcens

Left-censored Data Conversion
c.lcens

Combine Values into a Vector
dataCensored

Chesapeake Bay Program Monitoring Data, 1985-2016
.ExpLNiCens

Expectation maximization function: Log-normal case, i censured
censorLevels

Describe Censoring
censoring

Describe Censoring
baseDay

Base Day
convert2qw

Water-Quality Data
convertFqw

Water-Quality Data
.ExpNlCens

Expectation maximization function: Normal case, left censured
.ExpNiCens

Expectation maximization function: Normal case, i censured
closeOut

Document Processing Time and Other Session Time
.H1

Print out 1st level header (shortened pandoc.header)
censpp

Probability Plotting Positions
colorPlot

Plot Data
.H2

Print out 2nd level header (shortened pandoc.header)
.ExpLNmCens

Expectation maximization function: Log-normal case, Cens
.gamPlotCalc

plots data and gam fit vs. time
.ExpLNlCens

Expectation maximization function: Log-normal case, left censured
.initializeResults

#### Initialize stat.gam.result and chng.gam.result
as.double.qw

Numeric Representations
.T

Print out table title (customization of pandoc.emphasis and pandoc.strong )
baseDay2decimal

Base Day
.chkParameter

Reduce dataframe and parameter list based on user selected parameterFilt
.V

Print out text (blended pandoc.emphasis, .verbatim, and .strong)
.fmtPval

Format pvalues
.gamANOVA

Prepare ANOVA table for GAM analysis
.simCensored

Fit normal or log normal distribution; simulation in censored data provided by Elgin Perry phi.left and phi.right are distribution function, e.g., pnorm(q=10,mean=10,sd=1) =0.5 phi.sim is a uniform random number between phi.left and phi.right sim is imputed value
.layerAggregation

Aggregate data layers
.findFile

Find Recent File Information
.mergeFlow

merge flow variable into analysis data frame and update iSpec with variable name
.ExpLNrCens

Expectation maximization function: Log-normal case, right censured
.F

Print out figure title (customization of pandoc.emphasis and pandoc.strong )
baytrends

baytrends: Long Term Water Quality Trend Analysis
datePretty

Pretty Axis
dectime

Decimal Time
detrended.salinity

Create Seasonally Detrended Salinty Data Set
.H3

Print out 3rd level header (shortened pandoc.header)
dlimit

Impute Detection Limits
as.mcens

Multiply-censored Data Conversion
mdlKMstats

Estimate Statistics
format.lcens

Encode in a Common Format
mdlMLE

Estimate Statistics
gamDiff

Compute an estimate of difference based on GAM results
.vTable

Print out character vector table in wrapped mode
isCharLike

Test whether an object can be treated in a particular way
layerLukup

Layer List
makeColNames

Column Names
dectime2Date

Date Conversion
detrended.flow

Create Seasonally Detrended Flow Data Set
.ExpNmCens

Expectation maximization function: Normal case
.ExpNrCens

Expectation maximization function: Normal case, right censured
getUSGSflow

Retrieve USGS daily flow data in a wide format
group2row

Restructure Data
.H5

Print out 5th level header (shortened pandoc.header)
mean.lcens

Arithmetic Mean
.H4

Print out 4th level header (shortened pandoc.header)
.P

Paragraph (customization of pandoc.p)
.gamCoeff

Prepare table of coefficients for GAM analysis
.gamDiffPORtbl

Compute and present report on percent different for log-transformed data
eventNum

Event Processing
.H

Print out header (shortened pandoc.header)
print.censReg

Print Results
median.lcens

Median Value
print.censStats

Print Results
fillMissing

Fill Missing Values
mcenKM

Estimate Statistics
.appendDateFeatures

Appends date features to data frame
.reAttDF

Re-attribute df based on previous df
.mergeSalinity

merge salinity into analysis data frame and update iSpec with variable name
lcens-class

Left-censored Data
loadModelsResid

Load Built-in GAM formulas for calculating residuals
loadModels

Load Built-in GAM formulas
importRDB

Import Files
length.lcens

Length of an Object
renderPretty

Label Axes
mdlROS

Estimate Statistics
mean.qw

Arithmetic Mean
importQW

Water-Quality Data
importNWISqw

Water-Quality Data
impute

Impute Censored Values
print.censMCT

Print Results
imputeLessThans

Impute Censored Values
parameterList

Parameter List
residuals.censReg

Extract Model Residuals
seasAdjflow

Create Daily Seasonally-adjusted Log Flow Residuals
is.na.lcens

Missing Values
.checkRange

Check Data Range -- function that checks for allowable values
print.censQuantile

Print Results
rmse

Root-Mean-Squared and Relative Differences
mcenMLE

Estimate Statistics
loadData

Load/Clean CSV and TXT Data File
sal

Salinity data
loadExcel

Load/Clean Excel sheet
setColor

Colors
setGD

Graphics Page
selectData

Select data for analysis from a larger data frame
mcenROS

Estimate Statistics
setPlot

Plot Parameters
month.USGS

Month Abbreviations
na2miss

Recode Data
print.summary.censReg

Print Results
setExplan

Explanation
vif

Variance Inflation Factors
str.lcens

Display Structure
strip.blanks

Remove Spaces
filterWgts

Create filter weights
xyPlot

Plot Data
print.lcens

Print Values
flwAveragePred

Flow Averaged Predictions
gamPlotDisp

Plot censored gam fits vs. time
qw.export

qw.export
pcodeNWISqw

Parameter Code Information
summary.censReg

Summarizing Linear Model Fits
gamTest

Perform GAM analysis
timePlot

Time-series Plots
qw2mcens

Conversion to class "mcens"
qwCoalesce

Replace missing values
lineWt

Line Weights
%cn%

Partial Value Matching
setMargin

Graph Margins
linearPretty

Pretty Axis
mcens-class

Mutliply-censored Data
mdlKM

Estimate Statistics
qw.import

qw.import
setMultiPlot

Plot Parameters
ratio

Compute Ratios
splitQual

Split Leading Qualifiers
stationMasterList

Chesapeake Bay Program long-term tidal monitoring stations
rbindQW

Combine Data by Rows
namePretty

Pretty Axis
numericData

Numeric Values
%~=%

Possible Equality
quantile.lcens

Sample Quantiles
qw-class

Water-quality Data
saveDF

Save R object to disk
usgsGages

USGS Gages
sdlFill

Estimate Statistics
show-censored

Show Methods for WSqw objects
readNWQLdl

Historical Reporting Limits
vcov.censReg

Variance-Covariance Matrix
refLine

Reference Line
[.lcens

Subset an Object
summary.lcens

Summarize Data
sort.lcens

Sorting Vectors
timePretty

Pretty Axis
transData

Transform Data
as.data.frame.lcens

Coerce to a Data Frame
addCaption

Add Caption
analysisOrganizeData

Analysis Organization & Data Preparation
appendDateFeatures

Append Date Features
as.character.lcens

Character Representations
View

Invoke a Data Viewer
add

Add Water-Quality Data
Arith-censored

Arithmetic Methods for lcens, mcens, and qw objects
Math-censored

Mathematical Transform Methods for lcens objects