Learn R Programming

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

baytrends

Windowshttps://cranchecks.info/badges/flavor/windows/baytrends OSXhttps://cranchecks.info/badges/flavor/osx/baytrends Linuxhttps://cranchecks.info/badges/flavor/linux/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.

Installation

You can install the released version of baytrends from CRAN with:

install.packages("baytrends")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("tetratech/baytrends")

Copy Link

Version

Install

install.packages('baytrends')

Monthly Downloads

429

Version

1.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Erik Leppo

Last Published

March 31st, 2020

Functions in baytrends (1.2.1)

Q05078470

Daily Streamflow
add

Add Water-Quality Data
analysisOrganizeData

Analysis Organization & Data Preparation
addCaption

Add Caption
QWstacked

Stream Water Quality
QW05078470

Stream Water Quality
baytrends

baytrends: Long Term Water Quality Trend Analysis
baseDay2decimal

Base Day
as.mcens

Multiply-censored Data Conversion
baseDay

Base Day
as.double.qw

Numeric Representations
appendDateFeatures

Append Date Features
View

Invoke a Data Viewer
closeOut

Document Processing Time and Other Session Time
detrended.flow

Create Seasonally Detrended Flow Data Set
censorLevels

Describe Censoring
as.lcens

Left-censored Data Conversion
dataCensored

Chesapeake Bay Program Monitoring Data, 1985-2016
Arith-censored

Arithmetic Methods for lcens, mcens, and qw objects
c.lcens

Combine Values into a Vector
as.qw

Water-quality Data Conversion
censpp

Probability Plotting Positions
colorPlot

Plot Data
Math-censored

Mathematical Transform Methods for lcens objects
censoring

Describe Censoring
datePretty

Pretty Axis
detrended.salinity

Create Seasonally Detrended Salinty Data Set
convert2qw

Water-Quality Data
.H2

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

Print out 3rd level header (shortened pandoc.header)
as.character.lcens

Character Representations
.gamANOVA

Prepare ANOVA table for GAM analysis
dectime2Date

Date Conversion
dectime

Decimal Time
.H

Print out header (shortened pandoc.header)
.ExpNiCens

Expectation maximization function: Normal case, i censured
.H1

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

Expectation maximization function: Log-normal case, right censured
createResiduals

Calculate GAM residuals
.gamCoeff

Prepare table of coefficients for GAM analysis
dlimit

Impute Detection Limits
.ExpLNiCens

Expectation maximization function: Log-normal case, i censured
.vTable

Print out character vector table in wrapped mode
.appendDateFeatures

Appends date features to data frame
.ExpNrCens

Expectation maximization function: Normal case, right censured
as.data.frame.lcens

Coerce to a Data Frame
convertFqw

Water-Quality Data
.ExpNlCens

Expectation maximization function: Normal case, left censured
.V

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

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

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

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

Fill Missing Values
.initializeResults

#### Initialize stat.gam.result and chng.gam.result
.H4

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

Print out 5th level header (shortened pandoc.header)
.checkRange

Check Data Range -- function that checks for allowable values
.ExpNmCens

Expectation maximization function: Normal case
.layerAggregation

Aggregate data layers
.T

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

Plot censored gam fits vs. time
gamTest

Perform GAM analysis
eventNum

Event Processing
impute

Impute Censored Values
loadModelsResid

Load Built-in GAM formulas for calculating residuals
isLike

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

Perform GAM analysis for Specified Season
is.na.lcens

Missing Values
.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
.mergeFlow

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

Re-attribute df based on previous df
filterWgts

Create filter weights
.findFile

Find Recent File Information
.chkParameter

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

Paragraph (customization of pandoc.p)
imputeLessThans

Impute Censored Values
makeColNames

Column Names
logPretty

Pretty Axis
getUSGSflow

Retrieve USGS daily flow data in a wide format
mcenKM

Estimate Statistics
.fmtPval

Format pvalues
flwAveragePred

Flow Averaged Predictions
mcenMLE

Estimate Statistics
importRDB

Import Files
layerLukup

Layer List
loadExcel

Load/Clean Excel sheet
.mergeSalinity

merge salinity into analysis data frame and update iSpec with variable name
format.lcens

Encode in a Common Format
na2miss

Recode Data
importQW

Water-Quality Data
qwCoalesce

Replace missing values
loadModels

Load Built-in GAM formulas
lcens-class

Left-censored Data
median.lcens

Median Value
length.lcens

Length of an Object
mcens-class

Mutliply-censored Data
mdlKM

Estimate Statistics
mean.qw

Arithmetic Mean
month.USGS

Month Abbreviations
mcenROS

Estimate Statistics
mean.lcens

Arithmetic Mean
smwr.colors

Generate a Range of Colors
ratio

Compute Ratios
lineWt

Line Weights
.gamDiffPORtbl

Compute and present report on percent different for log-transformed data
print.censQuantile

Print Results
residuals.censReg

Extract Model Residuals
rmse

Root-Mean-Squared and Relative Differences
print.censReg

Print Results
pcodeNWISqw

Parameter Code Information
summary.censReg

Summarizing Linear Model Fits
namePretty

Pretty Axis
show-censored

Show Methods for WSqw objects
print.censStats

Print Results
saveDF

Save R object to disk
summary.lcens

Summarize Data
mdlROS

Estimate Statistics
print.lcens

Print Values
print.summary.censReg

Print Results
numericData

Numeric Values
.gamPlotCalc

plots data and gam fit vs. time
sal

Salinity data
vcov.censReg

Variance-Covariance Matrix
quantile.lcens

Sample Quantiles
gamDiff

Compute an estimate of difference based on GAM results
sdlFill

Estimate Statistics
gamPlotDisp

Plot censored gam fits vs. time
print.censMCT

Print Results
setColor

Colors
vif

Variance Inflation Factors
qw.export

qw.export
seasAdjflow

Create Daily Seasonally-adjusted Log Flow Residuals
group2row

Restructure Data
setMargin

Graph Margins
qw-class

Water-quality Data
setMultiPlot

Plot Parameters
refLine

Reference Line
stationMasterList

Chesapeake Bay Program long-term tidal monitoring stations
str.lcens

Display Structure
loadData

Load/Clean CSV and TXT Data File
[.lcens

Subset an Object
importNWISqw

Water-Quality Data
strip.blanks

Remove Spaces
linearPretty

Pretty Axis
%~=%

Possible Equality
setExplan

Explanation
selectData

Select data for analysis from a larger data frame
setAxis

Set up an Axis
mdlKMstats

Estimate Statistics
qw.import

qw.import
xyPlot

Plot Data
renderPretty

Label Axes
splitQual

Split Leading Qualifiers
sort.lcens

Sorting Vectors
parameterList

Parameter List
rbindQW

Combine Data by Rows
mdlMLE

Estimate Statistics
%cn%

Partial Value Matching
transData

Transform Data
qw2mcens

Conversion to class "mcens"
usgsGages

USGS Gages
pcodeColData

Selected USGS parameter Codes
readNWQLdl

Historical Reporting Limits
timePretty

Pretty Axis
setGD

Graphics Page
timePlot

Time-series Plots
setPlot

Plot Parameters