Learn R Programming

seawaveQ (version 1.0.0)

seawaveQPlots: Internal function that generates plots of data and model results.

Description

seawaveQPlots is usually called from within fitMod but can be invoked directly. It generates plots of data and model results, as well as diagnostic plots, and returns the observed and predicted concentrations so that users may plot the concentrations using their own functions.

Usage

seawaveQPlots(stpars, cmaxt, tseas, tseaspr, tndlin,
    tndlinpr, cdatsub, cavdat, cavmat, clog, centmp,
    yrstart, yrend, tyr, tyrpr, pnames, tanm, mclass = 1)

Arguments

stpars
is a matrix of information about the best seawaveQ model for the concentration data, see examplestpars.
cmaxt
is the decimal season of maximum chemical concentration.
tseas
is the decimal season of each concentration value in cdatsub.
tseaspr
is the decimal season date used to model concentration using the continuous data set cavdat.
tndlin
is the decimal time centered on the midpoint of the trend for the sample data, cdatasub.
tndlinpr
is is the decimal time centered on the midpoint of the trend for the continuous data, cavdat.
cdatsub
is the concentration data
cavdat
is the continuous (daily) ancillary data
cavmat
is a matrix containing the continuous ancillary variables.
clog
is a vector of the base-10 logarithms of the concentration data.
centmp
is a logical vector indicating which concentration values are censored.
yrstart
is the starting year of the analysis (treated as January 1 of that year).
yrend
is the ending year of the analysis (treated as December 31 of that year).
tyr
is a vector of decimal dates for the concentration data
tyrpr
is a vector of decimal dates for the continuous ancillary varaibles.
pnames
is the parameter (water-quality constituents) to analyze (if using USGS parameters, omit the the starting 'P', such as "00945" for sulfate).
tanm
is an a character identifier that names the trend analysis run. It is used to label output files.
mclass
has not been implemented yet, but will provide additional model options.

Value

  • a pdf file containing plots of the data and modeled concentrations and regression diagnostic plots and a list containing the observed concentrations (censored and uncensored) and the predicted concentrations used for the plot.

References

Mood, A.M., Graybill, F.A., and Boes, D.C., 1974, Introduction to the theory of statistics (3d ed.): New York, McGraw-Hill, Inc., 564 p.

Examples

Run this code
data(swData)
myPlots <- seawaveQPlots(stpars=examplestpars, cmaxt=0.4808743,
tseas=exampletseas, tseaspr=exampletseaspr, tndlin=exampletndlin,
tndlinpr=exampletndlinpr, cdatsub=examplecdatsub, cavdat=examplecavdat,
cavmat=examplecavmat, clog=exampleclog, centmp=examplecentmp,
yrstart=1995, yrend=2003, tyr=exampletyr, tyrpr=exampletyrpr,
pnames=c("04041"), tanm="examplePlots04041")

Run the code above in your browser using DataLab