diff --git a/R/multiPlotDataOverview.R b/R/multiPlotDataOverview.R index 8b966cb4..2c898f13 100644 --- a/R/multiPlotDataOverview.R +++ b/R/multiPlotDataOverview.R @@ -26,37 +26,34 @@ #' multiPlotDataOverview(eList, qUnit=1) multiPlotDataOverview<-function (eList, qUnit = 2,cex.main=1.2,rResid=FALSE, logScaleConc=TRUE, logScaleQ=TRUE){ - - multiPlotDataOverview<-function (eList, qUnit = 2,cex.main=1.2, - logScaleConc=TRUE, logScaleQ=TRUE,rResid=FALSE){ - - localINFO <- getInfo(eList) - - if(sum(c("paStart","paLong") %in% names(localINFO)) == 2){ - paLong <- localINFO$paLong - paStart <- localINFO$paStart - } else { - paLong <- 12 - paStart <- 10 - } - - title2<-if(paLong==12) "" else setSeasonLabelByUser(paStartInput=paStart,paLongInput=paLong) - par(mfcol=c(2,2),oma=c(0,2.4,4.5,2.4),tcl=0.5) - plotConcQ(eList, qUnit = qUnit, tinyPlot = TRUE, printTitle = FALSE, - rmSciX=TRUE,logScale=logScaleConc,rResid=rResid) - boxConcMonth(eList, printTitle = FALSE, tinyPlot=TRUE,logScale=logScaleConc) - plotConcTime(eList, printTitle = FALSE, tinyPlot = TRUE,logScale=logScaleConc,rResid=rResid) - boxQTwice(eList, printTitle = FALSE, qUnit = qUnit, tinyPlot=TRUE,logScale=logScaleQ) - title<-paste(localINFO$shortName,"\n",localINFO$paramShortName) - - if("" == title2){ - mtext(title,cex=cex.main,outer=TRUE,font=2) - } else { - title <- paste(title, title2, sep="\n") - mtext(title, cex = cex.main*.75, outer = TRUE, font = 2) - } - - par(mfcol=c(1,1),oma=c(0,0,0,0)) + localINFO <- getInfo(eList) + + if(sum(c("paStart","paLong") %in% names(localINFO)) == 2){ + paLong <- localINFO$paLong + paStart <- localINFO$paStart + } else { + paLong <- 12 + paStart <- 10 } + + title2<-if(paLong==12) "" else setSeasonLabelByUser(paStartInput=paStart,paLongInput=paLong) + + par(mfcol=c(2,2),oma=c(0,2.4,4.5,2.4),tcl=0.5) + plotConcQ(eList, qUnit = qUnit, tinyPlot = TRUE, printTitle = FALSE, + rmSciX=TRUE,logScale=logScaleConc,rResid=rResid) + boxConcMonth(eList, printTitle = FALSE, tinyPlot=TRUE,logScale=logScaleConc) + plotConcTime(eList, printTitle = FALSE, tinyPlot = TRUE,logScale=logScaleConc,rResid=rResid) + boxQTwice(eList, printTitle = FALSE, qUnit = qUnit, tinyPlot=TRUE,logScale=logScaleQ) + title<-paste(localINFO$shortName,"\n",localINFO$paramShortName) + + if("" == title2){ + mtext(title,cex=cex.main,outer=TRUE,font=2) + } else { + title <- paste(title, title2, sep="\n") + mtext(title, cex = cex.main*.75, outer = TRUE, font = 2) + } + + par(mfcol=c(1,1),oma=c(0,0,0,0)) + } \ No newline at end of file diff --git a/inst/doc/EGRET.pdf b/inst/doc/EGRET.pdf index 7fe4668c..9fb9a9fc 100644 Binary files a/inst/doc/EGRET.pdf and b/inst/doc/EGRET.pdf differ diff --git a/inst/doc/rResid.R b/inst/doc/rResid.R index dc5d40a4..8f83c1d9 100644 --- a/inst/doc/rResid.R +++ b/inst/doc/rResid.R @@ -6,6 +6,9 @@ plotConcTime(eList) ## ------------------------------------------------------------------------ plotConcQ(eList,qUnit=4) +## ------------------------------------------------------------------------ +plotResidQ(eList,qUnit=4) + ## ------------------------------------------------------------------------ eList <- makeAugmentedSample(eList) plotConcQ(eList, qUnit = 4, rResid = TRUE) @@ -20,7 +23,7 @@ plotResidQ(eList, qUnit = 4, rResid = TRUE) ## ----eval=FALSE---------------------------------------------------------- # eList <- makeAugmentedSample(eList) -## ------------------------------------------------------------------------ +## ----fig.height=8, fig.width=8------------------------------------------- multiPlotDataOverview(eList, qUnit = 4, rResid = TRUE) ## ----fig.height=10, fig.width=8------------------------------------------ diff --git a/inst/doc/rResid.Rmd b/inst/doc/rResid.Rmd index f2c97e0e..728c71a5 100644 --- a/inst/doc/rResid.Rmd +++ b/inst/doc/rResid.Rmd @@ -33,7 +33,7 @@ plotConcQ(eList,qUnit=4) It is difficult to see the relationship between ammonia concentration and discharge. If we look at residuals from a fitted WRTDS model and discharge we also find it difficult to see if the pattern looks reasonable (a horizontal cloud of points centered on the zero residual line) or if there is some substantial curvature to the relationship. -```{} +```{r} plotResidQ(eList,qUnit=4) ``` @@ -86,9 +86,8 @@ eList <- makeAugmentedSample(eList) 4. To produce any one of the following graphics, using the `rObserved` or `rResid` values simply add the argument `rResid = TRUE` to the call to the graphical function. Note that it doesn't matter if what is being plotted is an observed value or a residual, the argument is always `rResid = TRUE`. The original option of showing the vertical lines for censored values remains available as the default for any of these functions. The call can either say `rResid = FALSE` or just not include `rResid` in the argument list and the graphs will appear without these random values and without the open circle/closed circle symbology. The functions where this approach applies are these: `plotConcPred, plotConcQ, plotConcTime, plotConcTimeDaily, plotFluxPred, plotFluxQ, plotFluxTImeDaily, plotResidPred, plotResidQ, plotResidTime`. It is also available in the two multiple plot functions: `multiPlotOverview`, and `fluxBiasMulti`. -For example. -```{r} +```{r fig.height=8, fig.width=8} multiPlotDataOverview(eList, qUnit = 4, rResid = TRUE) ``` diff --git a/inst/doc/rResid.html b/inst/doc/rResid.html index d5f0d10d..fe2ba12a 100644 --- a/inst/doc/rResid.html +++ b/inst/doc/rResid.html @@ -94,7 +94,8 @@
plotConcQ(eList,qUnit=4)
It is difficult to see the relationship between ammonia concentration and discharge. If we look at residuals from a fitted WRTDS model and discharge we also find it difficult to see if the pattern looks reasonable (a horizontal cloud of points centered on the zero residual line) or if there is some substantial curvature to the relationship.
-plotResidQ(eList,qUnit=4)
+plotResidQ(eList,qUnit=4)
Here again, the plot is not very informative. What solutions might exist to resolve this problem of the graphical representation of the censored data?
The solid circles are the uncensored observations and the open circles are these rObserved
values. One thing to note is that if these values were to be generated a second time the graph would look slightly different. There is no unique set of values that will be plotted. The random numbers used will be different if we go back to the same data set and generate them again. Below we show such a figure and then redo the graphic with a second set of random numbers. The code is shown with the graphics.
eList <- makeAugmentedSample(eList)
plotConcQ(eList, qUnit = 4, rResid = TRUE)
# now do it all over again
eList <- makeAugmentedSample(eList)
plotConcQ(eList, qUnit = 4, rResid = TRUE)
Careful examination of these two figures reveals that the black dots are exactly the same in both, but the open circles are different between the two. In looking at these kinds of plots we are not necessarily looking to see what actually happened on a particular day, but rather to understand the pattern of the relationship between the two variables being plotted.
All three variables in this equation are in log concentration units.
We can look at our residuals plots in the following manner (using the second set of rObserved values computed above).
plotResidTime(eList, rResid = TRUE)
plotResidQ(eList, qUnit = 4, rResid = TRUE)
rObserved
or rResid
values simply add the argument rResid = TRUE
to the call to the graphical function. Note that it doesn’t matter if what is being plotted is an observed value or a residual, the argument is always rResid = TRUE
. The original option of showing the vertical lines for censored values remains available as the default for any of these functions. The call can either say rResid = FALSE
or just not include rResid
in the argument list and the graphs will appear without these random values and without the open circle/closed circle symbology. The functions where this approach applies are these: plotConcPred, plotConcQ, plotConcTime, plotConcTimeDaily, plotFluxPred, plotFluxQ, plotFluxTImeDaily, plotResidPred, plotResidQ, plotResidTime
. It is also available in the two multiple plot functions: multiPlotOverview
, and fluxBiasMulti
.For example.
multiPlotDataOverview(eList, qUnit = 4, rResid = TRUE)
fluxBiasMulti(eList, qUnit = 4, fluxUnit = 9, rResid = TRUE)