baytrends v1.1.0

0

Monthly downloads

0th

Percentile

Long Term Water Quality Trend Analysis

Enable users to evaluate long-term trends 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. The approach has been applied to water quality data in the Chesapeake Bay, a major estuary on the east coast of the United States to provide insights to a range of management- and research-focused questions.

Readme

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.

Functions in baytrends

Name Description
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
No Results!

Vignettes of baytrends

Name
data/dataCensored_TEST.csv
baytrends_overview.pdf
create_Seasonally_Detrended_Flow_and_Salinity_Data_Sets.Rmd
statgam_and_chnggam_output_fields.pdf
vignette_qw.Rmd
No Results!

Last month downloads

Details

Type Package
Date 2019-03-14
License GPL-3
LazyData TRUE
RoxygenNote 6.1.1
Encoding UTF-8
URL https://github.com/tetratech/baytrends
VignetteBuilder knitr
Collate 'a1_smwrQW_qw-class.R' 'a2_smwrQW_lcens-class.R' 'a3_smwrQW_mcens-class.R' 'analysisOrganizeData.R' 'appendDateFeatures.R' 'as.lcens.R' 'as.mcens.R' 'as.qw.R' 'baytrends.R' 'checkRange.R' 'chkParameter.R' 'closeOut.R' 'createResiduals.R' 'data.R' 'detrended.flow.R' 'detrended.salinity.R' 'expectMaxFunctions.r' 'findFile.R' 'flwAveragePred.R' 'fmtPval.R' 'gamDiff.R' 'gamPlotCalc.r' 'gamPlotDisp.R' 'gamTables.R' 'gamTest.r' 'getUSGSflow.R' 'headers2.R' 'imputeCensored.R' 'initializeResults.r' 'layerAggregation.R' 'loadData.R' 'loadExcel.R' 'loadModels.R' 'loadModelsResid.R' 'mergeFlow.R' 'mergeSalinity.R' 'qw.export.R' 'qw.import.R' 'reAttDF.R' 'saveDF.R' 'seasAdjflow2.R' 'selectData.R' 'smwrBase_baseDay.R' 'smwrBase_baseDay2decimal.R' 'smwrBase_dectime.R' 'smwrBase_dectime2Date.R' 'smwrBase_eventProcessing.R' 'smwrBase_fillMissing.R' 'smwrBase_group2row.R' 'smwrBase_importRDB.R' 'smwrBase_isLike.R' 'smwrBase_na2miss.R' 'smwrBase_z%cn%.R' 'smwrGraphs_addCaption.R' 'smwrGraphs_colorPlot.R' 'smwrGraphs_datePretty.R' 'smwrGraphs_lineWt.R' 'smwrGraphs_linearPretty.R' 'smwrGraphs_month.USGS.R' 'smwrGraphs_namePretty.R' 'smwrGraphs_numericData.R' 'smwrGraphs_refLine.R' 'smwrGraphs_renderPretty.R' 'smwrGraphs_setColor.R' 'smwrGraphs_setExplan.R' 'smwrGraphs_setGD.R' 'smwrGraphs_setMargin.R' 'smwrGraphs_setMultiPlot.R' 'smwrGraphs_setPage.R' 'smwrGraphs_setPlot.R' 'smwrGraphs_strip.blanks.R' 'smwrGraphs_timePlot.R' 'smwrGraphs_timePretty.R' 'smwrGraphs_transData.R' 'smwrGraphs_xyPlot.R' 'smwrQW_censoring.R' 'smwrQW_is.na.R' 'smwrQW_mcenKM.R' 'smwrQW_mcenMLE.R' 'smwrQW_mcenROS.R' 'smwrQW_mdlMLE.R' 'smwrQW_mdlROS.R' 'smwrQW_pcodeNWISqw.R' 'smwrQW_x_Arith-censored.R' 'smwrQW_x_Math-censored.R' 'smwrQW_x_View.r' 'smwrQW_x_add.R' 'smwrQW_x_as.character.R' 'smwrQW_x_as.data.frame.R' 'smwrQW_x_as.double.R' 'smwrQW_x_c.R' 'smwrQW_x_censorlevels.R' 'smwrQW_x_censpp.R' 'smwrQW_x_convert2qw.R' 'smwrQW_x_convertFqw.R' 'smwrQW_x_dlimit.R' 'smwrQW_x_format.R' 'smwrQW_x_importNWISqw.R' 'smwrQW_x_importQW.R' 'smwrQW_x_imputeLessThans.R' 'smwrQW_x_length.R' 'smwrQW_x_makeColNames.R' 'smwrQW_x_mdlKM.R' 'smwrQW_x_mdlKMstats.R' 'smwrQW_x_mean.qw.R' 'smwrQW_x_meanStats.R' 'smwrQW_x_medianStats.R' 'smwrQW_x_print.censMCT.R' 'smwrQW_x_print.censQuantile.R' 'smwrQW_x_print.censReg.R' 'smwrQW_x_print.censStats.R' 'smwrQW_x_print.summary.censReg.R' 'smwrQW_x_printData.R' 'smwrQW_x_quantile.R' 'smwrQW_x_qw2mcens.R' 'smwrQW_x_qwCoalesce.R' 'smwrQW_x_ratio.R' 'smwrQW_x_rbindQW.R' 'smwrQW_x_readNWQLdl.R' 'smwrQW_x_residuals.censReg.R' 'smwrQW_x_sdlFill.R' 'smwrQW_x_show-censored.R' 'smwrQW_x_sort.censored.R' 'smwrQW_x_splitQual.R' 'smwrQW_x_str.R' 'smwrQW_x_subset.R' 'smwrQW_x_summary.R' 'smwrQW_x_summary.censReg.R' 'smwrQW_x_vcov.censReg.R' 'smwrQW_x_z%eq%.R' 'smwrStats_rmse.R' 'smwrStats_vif.R' 'supportFunctions.R' 'zzz.R'
NeedsCompilation no
Packaged 2019-03-14 17:50:56 UTC; Erik.Leppo
Repository CRAN
Date/Publication 2019-03-14 18:23:27 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/baytrends)](http://www.rdocumentation.org/packages/baytrends)